Unit descriptions are not always consistent
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 71
- Forks
- 27
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 33
Description
In GitLab by @je-cook on Mar 9, 2022, 15:32
Summary
Units would benefit from be easily parsible from the dictionary definitions and most things should have a unit even if it is dimensionless
Suggested layout
- All units should be encapsulated in square brackets to aide parsing out of the description and not used elsewhere in description
- powers should be signified by a carat '^'
- No prefixes in units eg 1200MW -> GW and change the values of the variables accordingly
- should be parsible by pint (currency units are not so straight forward)
import pint; pint.Unit("W")
- ratio/fractions or other dimensionless units should be '[-]'
- \m3 -> m^-3
- Temperature should be ["degC"] or ["K"] or similar not C -> coulomb
- m^(-2).^(-1) (what...? isnt this just m^2)
- time 'y' is not a parsible unit 'yr' is
- Multiplicative (eg ohm.m) can be specified either with a dot between or without but no hypens
Some discussion is probably required for some units eg coil, neutrons (there is a particle unit that could be used)
Attached is the parsed state I have currently I've split it into a couple of sections which hopefully should make it easier to go through
each line is:
the string that is parsed - errors produced (if any, some are false positives or I dealt with) - regex search - pint unit - string to be replaced
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the attached process_units.md, reviewing each listed string, parse result, regex, Pint unit, and replacement. Use the suggested square-bracket, exponent, prefix, dimensionless, temperature, time, and multiplicative-unit rules as completion criteria, while resolving the noted coil and neutron cases through discussion.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100