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

a few additional units #859

Merged
merged 8 commits into from
Jul 6, 2023
Merged

a few additional units #859

merged 8 commits into from
Jul 6, 2023

Conversation

Alex-Jordan
Copy link
Contributor

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.

lib/Units.pm Outdated Show resolved Hide resolved
@Alex-Jordan
Copy link
Contributor Author

Alex-Jordan commented Jun 22, 2023 via email

@drgrice1
Copy link
Sponsor Member

Yeah, all of the fundamental units are defined first in the%known_units hash.

Copy link
Sponsor Member

@drgrice1 drgrice1 left a 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?

Comment on lines +238 to +253
gallon => {
factor => 0.00378541,
m => 3,
aliases => [ 'gallons', 'gal' ]
},
Copy link
Sponsor Member

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.

Copy link
Sponsor Member

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. 😄

Copy link
Contributor

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/

Copy link
Contributor Author

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.

@Alex-Jordan
Copy link
Contributor Author

Alex-Jordan commented Jun 22, 2023 via email

@pstaabp
Copy link
Sponsor Member

pstaabp commented Jun 26, 2023

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?

@pstaabp
Copy link
Sponsor Member

pstaabp commented Jun 26, 2023

@Alex-Jordan I put a PR into your branch. Also added the new units to the help file.

@Alex-Jordan
Copy link
Contributor Author

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.

@Alex-Jordan
Copy link
Contributor Author

I think I straightened this out.

@drgrice1
Copy link
Sponsor Member

drgrice1 commented Jul 6, 2023

A rebase should work fine.

@Alex-Jordan
Copy link
Contributor Author

It works better when you see there was a conflict and fix it, instead of just pushing it half-rebased.

@pstaabp pstaabp merged commit 0440842 into openwebwork:PG-2.18 Jul 6, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants