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

Proposal: unit confusion with default p&T #68

Open
jranalli opened this issue Oct 25, 2022 · 3 comments
Open

Proposal: unit confusion with default p&T #68

jranalli opened this issue Oct 25, 2022 · 3 comments
Labels

Comments

@jranalli
Copy link
Collaborator

jranalli commented Oct 25, 2022

I know this came up before in #29 and elsewhere. The documentation is correct at this point, so there's no bug, and please just mark this "wont fix" and close if you like.

I'm opening it though to make a proposal after I was looking at what we'd have to do to implement default value conversions for PMGI. My proposal is simple I think:

Add a pm.config['def_T_units'] and pm.config['def_p_units'] config value. This would enable building conversions based on those into all the _argparse methods and others that load default values.

Advantage: this kind of recasts def_T and def_p as a standard state (which in this case defaults to 25 deg C, 1 atm) instead of just being fixed numeric values. If calcs that use standard states (e.g. enthalpy of formation) ever become part of the library, that concept may have actual uses and so this may future proof. In terms of strict user experience though, I think it's reasonable to expect that users digging deep enough to change default p&T value settings could also update the corresponding unit flag.

@chmarti1
Copy link
Owner

This is definitely worth a discussion. I do see two concerns:
(1) This would break reverse compatibility in codes that set units. The change is not a major one, though.
(2) It bothers me deeply that it is possible to specify temperature and pressure using multiple unit systems simultaneously.

An alternative embodiment is trickier to implement, but addresses both concerns. It is possible to modify the configuration system so that changes to the temperature and pressure units automatically update the default values for the new unit system.

@jranalli
Copy link
Collaborator Author

jranalli commented Oct 26, 2022

(2) It bothers me deeply that it is possible to specify temperature and pressure using multiple unit systems simultaneously.

The one reason I felt this case justified the conflicting units was the notion of letting the default represent some standard state unless the user chooses to mess with it. My one thermo textbook actually lists its ref state as 25 deg C, 1 atm, and then goes on to report its computed values in K and kPa. Particularly with 1 atm, I think there's wide precedent for having that specified in different units from the working units.

In any event, I agree that modifying the config system is possible and would be more robust. I was mostly just trying to avoid proposing such a big undertaking 😄.

@chmarti1
Copy link
Owner

I mean any time the strongest argument begins with "It bothers me deeply..." there's a good chance I need to reconsider my position. Let me kick this around a little more - you may be right about this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants