Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added new units to Units.pm #753

Merged
merged 2 commits into from
Jan 4, 2023

Conversation

duffee
Copy link
Contributor

@duffee duffee commented Dec 12, 2022

This PR adds the Becquerel, the measure of radioactivity, and extends the second, metre, electron-volt, Coulomb, ampere and tesla to mostly smaller prefixes for electric and magnetic units. These are used in the areas of electromagnetism and nuclear physics with a couple for problems on optics and large power projects. Tests have been added for the new units in t/units/. It also corrects the spelling of mili to milli (double L).

When writing the test for adding new units with an optional hashref, the tests failed using syntax that I use in working problems. I've wrapped them in exception handling blocks and marked them with TODOs so that they pass, but are available for examination.

One point that might warrant discussion is the milliampere. I've added it as mamp which is consistent, but unappealing as it's not obvious what it is. I've also added mA which is in line with SI convention.

Units added:
microsecond, nanosecond
picometre, femtometre
tera electron-volt
Megawatt, milliwatt
milliCoulomb, microCoulomb, nanoCoulomb
milli-ampere
milli-tesla
Becquerel

Added:
microsecond, nanosecond
picometre, femtometre
tera electron-volt
Megawatt, milliwatt
milliCoulomb, microCoulomb, nanoCoulomb
milli-ampere
milli-tesla
Becquerel
and associated test files
t/units/conversions.t Outdated Show resolved Hide resolved
@pstaabp
Copy link
Sponsor Member

pstaabp commented Dec 19, 2022

Just to be clear, this doesn't changes the ampere unit to 'A'. correct?

I think you mentioned in #743 that this PR could be updated to include it.

Because "recent" won't be recent for very long
@duffee
Copy link
Contributor Author

duffee commented Dec 22, 2022

Correct - this PR doesn't change the ampere unit to A. I think that an alternative or alias for Angstrom needs to be added first, so that people have a chance to migrate to the new unit.

I have added the milliamp as both mamp and mA in anticipation that the ampere will eventually change from amp to A.

@drgrice1 drgrice1 merged commit 19f8f7c into openwebwork:develop Jan 4, 2023
@drgrice1
Copy link
Sponsor Member

drgrice1 commented Jan 4, 2023

@pstaabp: I thought you said that all of these tests were working. I guess I should have tried it myself. They aren't working.

@duffee duffee deleted the Units_new_electromag_nuclear branch January 5, 2023 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants