-
Notifications
You must be signed in to change notification settings - Fork 51
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 unified way of unit conversion #125
Comments
One thing I would like to keep constant is that the internal units are always kT — that's one of the fundamental assumptions. The parsers make sure that the data are in this common format. This means that unit conversion should only happen from kT into something else for downstream processing. The plotting functions take DataFrames as input so a natural way inside alchemlyb would be to have something like a postprocessor function (say We could also look into any number of python unit packages although I'd favor a light weight solution, especially as we are really only concerned with energy conversion from a fixed unit system. But if anyone has any ideas please make suggestions. Our plotting function could call the appropriate unit conversion depending on the value of @dotsdl @davidlmobley , any suggestions? What do you think @xiki-tempula ? |
I like the idea of carrying around units to avoid problems, so this sounds good. |
So I think the current general workflow would be
So the new plan would be
So the Unit conversion could happen through The temperature could be added to I think one way would be adding temperature as an input I'm not quite sure as to how to pass units around. |
I had in mind what you sketched out in your new plan. Originally I was thinking that the Graphic/text output step can do a unit conversion internally (using the same tools that one can use explicitly). However, if we find a way to carry units and temperature around with the df then this can be done automatically. I do not like to keep global state with global variables. All of alchemlyb is written in a way to avoid keeping global state as much as possible. |
So I would imagine using attrs to pass the temperature around (if the temperature is not set as a global variable).
|
Makes sense to me. In addition to The main challenge is going to be what happens when someone manipulates the df externally and the attrs get lost. They do not automatically get copied on slicing a df. I have two ideas:
However, I'd like to keep things simple so I am in favor of 1. |
Btw, maybe |
In the I'm thinking of having a decorator pass the attributes from the input data frame to the output data frame during the
The I suppose the checking procedure could be implemented to the |
I think your plan is good. |
I tried to implement this plan in #129。 It seems that attr is only supported from pandas 1.0 which doesn't support py2 and py35. |
Can you please raise an issue for dropping py 2.7 and 3.5 support?
… Am 5/15/21 um 07:55 schrieb Zhiyi Wu ***@***.***>:
I tried to implement this plan in #129 but it seems that attr is only supported from pandas 1.0 which doesn't support py2 and py35.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
- state explicitly supported Python on OS - move Changes to top position and reordered changes by importance - added explicit item for unit-awareness (#125) - add date
Currently, the internal unit is always kt. However, when presenting the data, it might be desirable to present the data in kcal/mol or kj/mol. Thus, it would be a good idea to have a discussion on how to do the unit conversion.
Currently, the only place that requires unit conversion is the plotting functions and later on the workflow #114.
My proposal is that the plotting function will be taking a conversion factor that converts kt to the desired unit.
The text was updated successfully, but these errors were encountered: