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

magres_old parsing improvements #189

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

jkshenton
Copy link
Collaborator

I've added in something to parse extra information in magres_old blocks. A lot of it will be redundant information (i.e. also in the regular magres block), but the hyperfine tensors, for example, aren't written out in the magres blocks, only magres_old.

Done:

  • output from magres_old blocks now mirrors standard magres block
  • magres_old can now parse
    • ms
    • efg
    • isc_*
    • hf (hyperfine tensors)
  • updated test magres file to include new quantities in magres_old
  • changed the structure of the tensors in magres block to ThreeByThreeMatrix to remove any ambiguity in ordering (row vs col)
  • Updated test json and yaml files to the new structure

Optional things left to do:

  • Add in summaries of tensors

For now I removed the parsing of the eigenvectors/values and the isotropy etc. for each tensor - these could be added back in, but then maybe a structure like:

- magres_old
    - magnetic_shielding | electric_field_gradient | hyperfine | j_coupling
        - atomindex | atomindex1,atomindex2
            - tensor
            - eigenvalues
            - eigenvectors
            - isotropy
            - anisotropy
            - asymmetry
  • Combine magres and magres_old data to remove redundancy

@jkshenton jkshenton requested a review from oerc0122 February 5, 2025 17:41
Copy link
Owner

@oerc0122 oerc0122 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this, starting to look a lot better! Just some style questions and hopefully simplified RE structure.

@jkshenton
Copy link
Collaborator Author

Thanks for the comments and suggestions @oerc0122 , I think I've addressed all of them now.

Do you have thoughts on

  1. merging redundant data (much of the magres_old block has the same info as the magres block, so it could be used to sanity-check, for example. I mainly to parse the magres_old block for the hyperfine tensors (which only appear in the magres_old, not in the magres one - for now...). One option could be to add in the missing data into a single magres output (rather than having magres and magres_old), though that might violate the design of this library (?)
  2. We could add in the eigenvectors/values and isotropy etc. - these are redundant in that you can compute these quantities based on the tensors that are parse, but they might help people debug conventions etc...?

@oerc0122
Copy link
Owner

oerc0122 commented Feb 6, 2025

Thanks for the comments and suggestions @oerc0122 , I think I've addressed all of them now.

Do you have thoughts on

  1. merging redundant data (much of the magres_old block has the same info as the magres block, so it could be used to sanity-check, for example. I mainly to parse the magres_old block for the hyperfine tensors (which only appear in the magres_old, not in the magres one - for now...). One option could be to add in the missing data into a single magres output (rather than having magres and magres_old), though that might violate the design of this library (?)
  2. We could add in the eigenvectors/values and isotropy etc. - these are redundant in that you can compute these quantities based on the tensors that are parse, but they might help people debug conventions etc...?

I think that duplicating data is probably unnecessary.

Ultimately, I'm not sure we want the magres, magres_old separation. It was there because that was the file structure, but I think we just want the magres dictionary as a whole as that's all the useful information in the file, to that end, I think adding the eigenvectors/value, etc. would be a good thing. If people don't want them they can not use them quite easily, but if information's not there, they can't.

oerc0122
oerc0122 previously approved these changes Feb 8, 2025
Copy link
Owner

@oerc0122 oerc0122 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Depending on your thoughts and what you're using, we can leave the merging of magres and magres_old until the refactor to an iterative form. It will, however, be an API breaking change.

@oerc0122 oerc0122 force-pushed the magres_old_block_parsing branch 3 times, most recently from 178a402 to 92dd918 Compare February 12, 2025 10:00
- output from magres_old blocks now mirrors standard magres block
-  magres_old can now parse
   - ms
   - efg
   - isc_*
   - hf (hyperfine tensors)
- updated test magres file to include new quantities in magres_old
- changed the structure of the tensors in magres block to ThreeByThreeMatrix to remove any ambiguity in ordering (row vs col)
- Updated test json and yaml files to the new structure
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.

2 participants