-
-
Notifications
You must be signed in to change notification settings - Fork 76
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
a few additional units #859
Conversation
Yeah, all of the fundamental units are defined first in the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. But how far do we go with this?
gallon => { | ||
factor => 0.00378541, | ||
m => 3, | ||
aliases => [ 'gallons', 'gal' ] | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there are some other related units that could be added here. Pint and quart go with these volume measurements, and are equally standard with cup and gallon. There are also teaspoon and tablespoon, that are rather common. If you really want to go the distance there are also pottle, barrel, shot, gill, hogshead, etc. I haven't heard of some of those before. Some fun names too! See customary US units.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll have a hogsheads of mead with lunch today. 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For those that like extreme edge cases, the Gal is the acceleration of 1 cm/s^2, but was deprecated by the Int. Ast. Union in 1989. Probably an idea to include a comment that the gallon is US, not Imperial.
https://en.wikipedia.org/wiki/Gal_(unit)
https://www.iau.org/publications/proceedings_rules/units/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@duffee In the help file, I put "US " in front of the title for each of gallon, quart, pint, and cup.
I'm fine with going further. But here are some possible principles that
could restrain us.
Any reasonably common unit for stem problems should be in there. Gallons
counts, hogshead not.
For any unit in there, all reasonable aliases in the context of what a
student might type should be available. Like "meter".
Individual problems can always add new units like hogshead.
Questions I have though:
* What about metre and litre?
* We have L and ml but not mL.
* Students can want to type periods after some units, should we cater to
that?
As far as this pr goes these are currently just the units we've added at
PCC.
…On Thu, Jun 22, 2023, 4:48 AM Peter Staab ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In lib/Units.pm
<https://protect2.fireeye.com/v1/url?k=31323334-501d2dca-3132feb7-454455534531-358f5e94aed31082&q=1&e=d27fb774-d519-4d9f-bf33-90c312502b68&u=https%3A%2F%2Fgithub.com%2Fopenwebwork%2Fpg%2Fpull%2F859%23discussion_r1238414683>
:
> + gallon => {
+ factor => 0.00378541,
+ m => 3,
+ aliases => [ 'gallons', 'gal' ]
+ },
I'll have a hogsheads of mead with lunch today. 😄
—
Reply to this email directly, view it on GitHub
<https://protect2.fireeye.com/v1/url?k=31323334-501d2dca-3132feb7-454455534531-358f5e94aed31082&q=1&e=d27fb774-d519-4d9f-bf33-90c312502b68&u=https%3A%2F%2Fgithub.com%2Fopenwebwork%2Fpg%2Fpull%2F859%23discussion_r1238414683>,
or unsubscribe
<https://protect2.fireeye.com/v1/url?k=31323334-501d2dca-3132feb7-454455534531-73d05be5d0b326d1&q=1&e=d27fb774-d519-4d9f-bf33-90c312502b68&u=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FABEDOAHGHCEJCBNBH5FMJPLXMQWH5ANCNFSM6AAAAAAZPOBAV4>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
I'm prepping a PR to this branch for pints and quarts and adding some tests for these. Should I add 'litre(s)', 'metre(s)' etc. to this as well? |
@Alex-Jordan I put a PR into your branch. Also added the new units to the help file. |
I accidentally rebased on 2.18 instead of merging 2.18 here. The GitHub diff looks weird now. I'll see if I can fix it. |
I think I straightened this out. |
A rebase should work fine. |
It works better when you see there was a conflict and fix it, instead of just pushing it half-rebased. |
In upgrading my production server, I had to take notice of all the customizations we've added. These are some that are worth contributing. I was especially surprised to see that gallons are missing.