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

Fix nexus parsing for NOMAD #304

Merged
merged 12 commits into from
Apr 16, 2024
Merged

Fix nexus parsing for NOMAD #304

merged 12 commits into from
Apr 16, 2024

Conversation

domna
Copy link
Collaborator

@domna domna commented Mar 30, 2024

See related issue https://gitlab.mpcdf.mpg.de/nomad-lab/nomad-FAIR/-/merge_requests/1731

  • One problem was related to a caching issue, i.e., lru_cache always returns the same object if it has been cached already. If this object is altered, the altered object gets returned for subsequent calls of the lru_cached function. See this stackoverflow question for more information: https://stackoverflow.com/questions/54909357/how-to-get-functools-lru-cache-to-return-new-instances. I simply avoid this now by making a copy after the function call. Maybe we'd need to investigate for other objects of this function call and/or in other places if we have the same problem there
  • A second problem originated in the get_nxdl_attr_doc function which added attribute nodes twice. This was due to the fact that all attributes which are part of the inheritance chain were added instead of only the lowest child. Maybe this problem also exists for fields.

I made some remarks on the general code quality in #303

@coveralls
Copy link

coveralls commented Mar 30, 2024

Pull Request Test Coverage Report for Build 8701886089

Details

  • 7 of 10 (70.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.01%) to 77.874%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pynxtools/nexus/nexus.py 7 10 70.0%
Totals Coverage Status
Change from base Build 8647780955: 0.01%
Covered Lines: 2615
Relevant Lines: 3358

💛 - Coveralls

Copy link
Collaborator

@sanbrock sanbrock left a comment

Choose a reason for hiding this comment

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

LGTM

@domna domna requested a review from sanbrock April 4, 2024 06:48
@domna domna force-pushed the fix-nexus-parsing branch from 8809fa2 to 117bdc3 Compare April 10, 2024 16:34
@domna domna merged commit 6960709 into master Apr 16, 2024
7 checks passed
@domna domna deleted the fix-nexus-parsing branch April 16, 2024 09:54
Copy link
Collaborator

@sanbrock sanbrock left a comment

Choose a reason for hiding this comment

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

LGTM

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.

3 participants