-
Notifications
You must be signed in to change notification settings - Fork 10
use orjson
to store metainfo package
#613
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
base: master
Are you sure you want to change the base?
Conversation
orjson
to store metainfo package
When loading the pynxtools metainfo package from the stored file However, in parsing, there is an error along the lines of For the error above, it basically comes from So basically, my main questions are:
@lauri-codes @blueraft @DanielYang59 any suggestions why this may be the case? cc @sanbrock |
Problem is that these two objects are not exactly the same. In debug mode,
On the other hand, if we generate the schema from scratch, they are indeed the same object:
So it seems that somewhere in the serialization and reloading of the schema the memory address changes, but I don't understand this well enough. We reproduced the same error when using a small test json file that only contains the section definitions needed for reproducing the error, see attached. In order to check this schema, you need to replace the name in the |
I can also reproduce this! cc: @TLCFEM since this is something related to the metainfo. |
Try set |
I still get the same issue, the ids do not match. I also tried |
@lukaspie Please apply and check if everything works. |
Long story short, |
With this PR, the next |
I think the original idea was that pynxtools can be used standalone (for data conversion), so it was meant to be a lightweight install outside of NOMAD. I think after pluginization, we should have probably added In any case, we can probably only publish after the next nomad release anyway, right? |
I would argue we still should keep this independence. There should definitely be a standalone installation without nomad possible. We could create an optional dependency group, e.g. [nomad] that defines the required nomad version, though. |
So, we could have a If I remember correctly, there were problems when using optional dependencies (like we had before with |
In |
That's more or less what I mean, yes. Not sure about the uv pip compile, though. I guess we need to test it. |
Yeah sorry, this is what I meant, just a lower bound. |
0ae4739
to
ca15b4f
Compare
@rettigl I have implemented it now that the json file is created before the |
a208554
to
eae2e5f
Compare
This is totally fine. I only think it would be good to avoid doing every time you start up nomad, which already takes quite long for building the nexus metainfo. |
echo "ERROR: nxs_metainfo_package_*.json not found in installed package." | ||
exit 1 | ||
else | ||
echo "Found $FILE_COUNT JSON file(s) in package:" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't we test if the found package(s) correspond(s) to the actual definitions submodule?
scripts/update_definitions.sh
Outdated
# Updates the definitions and generates the metainfo package. | ||
# Only works if you have pynxtools installed in editable mode. | ||
|
||
update_nexus_version() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cannot we either put the common functions to a common file being sourced, or make a generic script which behaves differently based on a parameter (update vs. reset)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed to a single script with a parameter
figure_host = archive.data | ||
# apend the figure to the figures list | ||
figure_host.figures = [PlotlyFigure(figure=fig.to_plotly_json())] | ||
for section in sections: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would we gain additional time, if these attributes are also saved/loaded?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thy are saved/loaded with this approach.
118a5ec
to
6286ec1
Compare
9bb456e
to
eb4aea2
Compare
No description provided.