Skip to content

Resolve "Packages aliases in metainfo"

Markus Scheidgen requested to merge 1886-packages-aliases-in-metainfo into develop

This MR uses the alias property on Package definitions, e.g.

m_package = Package(aliases=['some.other.python.package.name'])

class MySection(MSection):
...

m_package.__init__metainfo__()

I checked that you can now:

  • process an .archive.json file with an "m_def": "some.other.python.package.name.MySection" in it.
  • you can reprocess an entry that was previously processed and has an "m_def": "some.other.python.package.name.MySection" in the archive.
  • the gui shows the data for an entry with "m_def": "some.other.python.package.name.MySection" in it.

This should cover most cases when refactoring package names:

  • using the ArchiveQuery on old data (or instantiating it otherwise)
  • showing old data in the gui

There are use cases were this does not work:

  • querying with for a python based section definition name as a search criteria

!!! This is only for refactoring python package names. This is not about changing sub-section names. This will require another MR.

!!! This also only works for packages that are known and loaded in the backend. Therefore, this only works for python packages in nomad-lab or plugins. It does not work for any uploaded ".yaml" schemas.

Closes #1886 (closed)

Edited by Markus Scheidgen

Merge request reports