FAIRmat-NFDI / nomad-parser-vasp

NOMAD parser plugin for VASP input/output files.
Apache License 2.0
1 stars 1 forks source link

Tutorial 14 #6

Closed JFRudzinski closed 2 days ago

JFRudzinski commented 2 months ago

This is a dummy PR to get some feedback, this will/should never be merged

JFRudzinski commented 2 months ago

outputs of run in the venv (non-editable installation of nomad-simulations) and the

See archive.data.outputs[0].total_energy[0], I have a notebook with tests: tests/test_parser.ipynb, you can check the locations there

JFRudzinski commented 2 months ago

@Bernadette-Mohr I pushed a few small changes to the branch, I don't think it really affects you, but you may want to pull them for consistency

Bernadette-Mohr commented 2 months ago

outputs of run in the venv (non-editable installation of nomad-simulations) and the

See archive.data.outputs[0].total_energy[0], I have a notebook with tests: tests/test_parser.ipynb, you can check the locations there

When running the second cell of the notebook (conda kernel), I run into the following error:

{
    "name": "AttributeError",
    "message": "total_energy",
    "stack": "---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[2], line 4
      2 p = VasprunXMLParser()
      3 a = EntryArchive()
----> 4 p.parse(path + 'vasprun.xml.relax', a, logger=logger)
      6 MetainfoNormalizer().normalize(archive=a)

File ~/software/nomad-parser-vasp/src/nomad_parser_vasp/parsers/xml_parser.py:109, in VasprunXMLParser.parse(self, mainfile, archive, logger, child_archives)
    107 output = Outputs()
    108 archive.data.outputs.append(output)
--> 109 output.total_energy.append(TotalEnergy(value=total_energy))
    110 output.total_energy[0].contributions.append(HartreeDCEnergy(value=hartreedc))
    111 output.total_energy[0].contributions.append(XCdcEnergy(value=xcdc))

File ~/micromamba/envs/nomad/lib/python3.9/site-packages/nomad/metainfo/metainfo.py:1131, in MSection.__getattr__(self, name)
   1127         raise AttributeError(name)
   1129     return self.m_get_annotations(annotation_name)
-> 1131 raise AttributeError(name)

AttributeError: total_energy"
}
JFRudzinski commented 2 months ago

seems maybe like a version thing again. can you try importing the TotalEnergy class directly? If not we will have to solve it Mon :(

JFRudzinski commented 1 month ago

This branch can now be installed with the proper nomad-simulations dependencies in the toml, and so only the explicit installation of the parser plugin (not nomad-simulations) needs to be done for this example. However, this means that to run the parser example, one MUST use the notebook rather than the nomad-lab interface (unless you link up the parser of course).