Closed stevenhua0320 closed 5 months ago
Yeah the function is added to apply_corr() in the corrected diffraction objects. Unless you meant to add it to diffpy.utils?
Yeah the function is added to apply_corr() in the corrected diffraction objects. Unless you meant to add it to diffpy.utils?
We probably want it in the diffraction_objects themselves. but this will capture the name and version of diffpy.utils used for the diffraction object. If we also want to capture the version of labpdfproc then we will also need it in apply_corr().
How about this for a design:
We need to think what we want the dumped file header to look like that is the most useful. Do you guys want to suggest something?
e.g., in the file, a nice human readable thing might be:
package_versions: diffpy.labpdfproc v1.3.4, diffpy.utils v2.4.5
but it could be something different.
e.g., in the file, a nice human readable thing might be:
package_versions: diffpy.labpdfproc v1.3.4, diffpy.utils v2.4.5
but it could be something different.
Yeah, I think these information is enough for users to obtain useful information about the package number and version for the file. So, does that mean that we also need to define the functionality of load package name and version in diffpy.utils, probably implement with a public function?
I will add some UCs to help clarify but after I am through security at the airport!
On Thu, May 30, 2024, 10:52 AM Yucong (Alice) Chen @.***> wrote:
- Just want to make sure that for package versions, we want to load both labpdfproc and diffpyutils packages instead of overriding, so we're adding labpdfproc version when we call the function there?
- Would it be better if we pass the package version as an argument to dump like what was done with xtype=None? So that we can take care of package version outside of dump and just write what's needed.
- We can add the time attribute directly in dump function?
— Reply to this email directly, view it on GitHub https://github.com/diffpy/diffpy.labpdfproc/pull/74#issuecomment-2139793712, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABAOWUJK6GJ4YTEXSYPU4ITZE44LLAVCNFSM6AAAAABIQ4JU3SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMZZG44TGNZRGI . You are receiving this because you commented.Message ID: <diffpy/diffpy. @.***>
I can get started now:
Uc1
Uc2
Uc3
Uc4
On Thu, May 30, 2024, 11:10 AM Simon Billinge @.***> wrote:
I will add some UCs to help clarify but after I am through security at the airport!
On Thu, May 30, 2024, 10:52 AM Yucong (Alice) Chen < @.***> wrote:
- Just want to make sure that for package versions, we want to load both labpdfproc and diffpyutils packages instead of overriding, so we're adding labpdfproc version when we call the function there?
- Would it be better if we pass the package version as an argument to dump like what was done with xtype=None? So that we can take care of package version outside of dump and just write what's needed.
- We can add the time attribute directly in dump function?
— Reply to this email directly, view it on GitHub https://github.com/diffpy/diffpy.labpdfproc/pull/74#issuecomment-2139793712, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABAOWUJK6GJ4YTEXSYPU4ITZE44LLAVCNFSM6AAAAABIQ4JU3SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMZZG44TGNZRGI . You are receiving this because you commented.Message ID: <diffpy/diffpy. @.***>
Ok, that's it
On Thu, May 30, 2024, 11:17 AM Simon Billinge @.***> wrote:
I can get started now:
Uc1
- Diffraction object wants to save it's version on s human readable form in an output file by default
- Diffpy.utils does this by saving it's version
Uc2
- Labpdfproc wants to save it's version on s human readable form in an output file by default
- LPP is using diffraction objects so it does it by extending the behavior in DO
Uc3
- As 1.2 but for pdfgetx3 but X3 is refactored to use DO
Uc4
- Diffraction programmer is writing their own program and not using DO and want to use their own formatting but have diffpy.utils already as a dependency
- They use a helper function from utilities to easily get the information then use it to write their own output code
On Thu, May 30, 2024, 11:10 AM Simon Billinge @.***> wrote:
I will add some UCs to help clarify but after I am through security at the airport!
On Thu, May 30, 2024, 10:52 AM Yucong (Alice) Chen < @.***> wrote:
- Just want to make sure that for package versions, we want to load both labpdfproc and diffpyutils packages instead of overriding, so we're adding labpdfproc version when we call the function there?
- Would it be better if we pass the package version as an argument to dump like what was done with xtype=None? So that we can take care of package version outside of dump and just write what's needed.
- We can add the time attribute directly in dump function?
— Reply to this email directly, view it on GitHub https://github.com/diffpy/diffpy.labpdfproc/pull/74#issuecomment-2139793712, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABAOWUJK6GJ4YTEXSYPU4ITZE44LLAVCNFSM6AAAAABIQ4JU3SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMZZG44TGNZRGI . You are receiving this because you commented.Message ID: <diffpy/diffpy. @.***>
Uc3 and uc2 are the same UC but this highlights the level of reusability we are looking for
On Thu, May 30, 2024, 11:18 AM Simon Billinge @.***> wrote:
Ok, that's it
On Thu, May 30, 2024, 11:17 AM Simon Billinge @.***> wrote:
I can get started now:
Uc1
- Diffraction object wants to save it's version on s human readable form in an output file by default
- Diffpy.utils does this by saving it's version
Uc2
- Labpdfproc wants to save it's version on s human readable form in an output file by default
- LPP is using diffraction objects so it does it by extending the behavior in DO
Uc3
- As 1.2 but for pdfgetx3 but X3 is refactored to use DO
Uc4
- Diffraction programmer is writing their own program and not using DO and want to use their own formatting but have diffpy.utils already as a dependency
- They use a helper function from utilities to easily get the information then use it to write their own output code
On Thu, May 30, 2024, 11:10 AM Simon Billinge @.***> wrote:
I will add some UCs to help clarify but after I am through security at the airport!
On Thu, May 30, 2024, 10:52 AM Yucong (Alice) Chen < @.***> wrote:
- Just want to make sure that for package versions, we want to load both labpdfproc and diffpyutils packages instead of overriding, so we're adding labpdfproc version when we call the function there?
- Would it be better if we pass the package version as an argument to dump like what was done with xtype=None? So that we can take care of package version outside of dump and just write what's needed.
- We can add the time attribute directly in dump function?
— Reply to this email directly, view it on GitHub https://github.com/diffpy/diffpy.labpdfproc/pull/74#issuecomment-2139793712, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABAOWUJK6GJ4YTEXSYPU4ITZE44LLAVCNFSM6AAAAABIQ4JU3SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMZZG44TGNZRGI . You are receiving this because you commented.Message ID: <diffpy/diffpy .@.***>
Got it, I understand now. We'll start working on it soon!
@stevenhua0320 I am closing this. Please could you update your diffpy.utils (you will have to install it in develop mode as we haven't released it to conda-forge yet, @yucongalicechen can help), then make a new branch on a clean main and redo this making use of the package_info
function in diffpy.utils.tools
@yucongalicechen we probably need a PR with documentation in diffpy.utils for how to use that function. It might be good if you write that documentation first and we can see if Steven can follow it.....
@stevenhua0320 I am closing this. Please could you update your diffpy.utils (you will have to install it in develop mode as we haven't released it to conda-forge yet, @yucongalicechen can help), then make a new branch on a clean main and redo this making use of the
package_info
function indiffpy.utils.tools
@yucongalicechen we probably need a PR with documentation in diffpy.utils for how to use that function. It might be good if you write that documentation first and we can see if Steven can follow it.....
OK, I would follow yucong's instructions on updating utils and then using utils functionality to load these infos in labpdfproc.
Closes #28 #29 Initial commit to dynamically load the datetime of analysis, package name, and package version into metadata using monkeypatch. Not sure whether it should be set as an attribute or directly loaded into it.