nomad-coe / nomad

NOMAD lets you manage and share your materials science data in a way that makes it truly useful to you, your group, and the community.
https://nomad-lab.eu
Apache License 2.0
64 stars 14 forks source link

JOSS Review: Several packages missing from installation with `pip install nomad-lab[parsing]` #63

Closed Andrew-S-Rosen closed 11 months ago

Andrew-S-Rosen commented 1 year ago

In the documentation, it states to use pip install nomad-lab[parsing] for parsing-related dependencies. However, doing so does not install all the pre-requisite packages for parsing. For instance, the following are not included but are needed: mongoengine, jwt, and unidecode. These are installed with the pip install nomad-lab[infrastructure] extras, but if the user is primarily interested in parsing, they may not install these extras (or know to install them).

TLCFEM commented 1 year ago

Not sure why mongoengine is involved if one only parses files. Any bt available?

Andrew-S-Rosen commented 1 year ago

I'll report back with a backtrace, but I ran normalize_all() as well per the docs, so perhaps that's where the source was.

Andrew-S-Rosen commented 1 year ago

Overview

It looks like the issue arises because, in the docs, it suggests to use normalize_all() on the archive that is parsed, but the requirements for normalize_all() are not all installed with the [parsing] extras. You can run parse() appropriately, so I guess it's a matter of if you want the user to be able to normalize_all() if they install the [parsing] extras only.

Details of Build

System: Ubuntu via WSL

conda create --name joss_test python=3.9
conda activate joss_test
pip install -e .[parsing] # from https://github.com/arosen93/nomad/tree/develop

Note: I am using a fork of the repo because https://github.com/nomad-coe/nomad/issues/44 is preventing me from running the parsers unless I hard-code where the tools.json file is located.

Code to Run

from nomad.client import parse, normalize_all

archive = parse('vasprun.xml')
normalize_all(archive)
section_run = archive.run[0]
python_dict = section_run.m_to_dict()

vasprun.xml.txt

Note: The docs say to use archive = parse(sys.argv[1]) but that doesn't work for me:

----> 1 archive = parse(sys.argv[1])

IndexError: list index out of range

So, I manually put in the filepath instead.

Tracebacks

ModuleNotFoundError                       Traceback (most recent call last)
Cell In[1], line 7
      5 archive = parse('vasprun.xml')
      6 # run all normalizers
----> 7 normalize_all(archive)
      9 # get the 'main section' section_run as a metainfo object
     10 section_run = archive.run[0]

File /mnt/c/Users/asros/github/nomad/nomad/client/processing.py:94, in normalize_all(entry_archive, logger)
     90 def normalize_all(entry_archive, logger=None):
     91     '''
     92     Parse the downloaded entry and run the whole normalizer chain.
     93     '''
---> 94     from nomad import normalizing
     96     for normalizer in normalizing.normalizers:
     97         if normalizer.domain is None or normalizer.domain == entry_archive.metadata.domain:

File /mnt/c/Users/asros/github/nomad/nomad/normalizing/__init__.py:41
     19 '''
     20 After parsing entries have to be normalized with a set of *normalizers*.
     21 In NOMAD-coe those were programmed in python (we'll reuse) and scala (we'll rewrite).
   (...)
     36     :members:
     37 '''
     39 from typing import List, Any, Iterable, Type
---> 41 from .system import SystemNormalizer
     42 from .optimade import OptimadeNormalizer
     43 from .dos import DosNormalizer

File /mnt/c/Users/asros/github/nomad/nomad/normalizing/system.py:26
     24 import json
     25 import re
---> 26 from matid import SymmetryAnalyzer, Classifier  # pylint: disable=import-error
     27 from matid.classifications import Class0D, Atom, Class1D, Material2D, Surface, Class3D  # pylint: disable=import-error
     29 from nomad import atomutils, archive

File /mnt/c/Users/asros/github/nomad/dependencies/matid/matid/__init__.py:1
----> 1 from matid.classification.classifier import Classifier
      2 from matid.classification.periodicfinder import PeriodicFinder
      3 from matid.symmetry.symmetryanalyzer import SymmetryAnalyzer

File /mnt/c/Users/asros/github/nomad/dependencies/matid/matid/classification/classifier.py:17
      7 from matid.classifications import \
      8     Surface, \
      9     Atom, \
   (...)
     14     Class2D, \
     15     Class3D
     16     # Crystal
---> 17 import matid.geometry
     18 from matid.data import constants
     19 from matid.classification.periodicfinder import PeriodicFinder

File /mnt/c/Users/asros/github/nomad/dependencies/matid/matid/geometry.py:20
     17 from matid.core.linkedunits import Substitution
     18 import matid.geometry
---> 20 from sklearn.cluster import DBSCAN
     22 from scipy.spatial import Delaunay
     23 import spglib

ModuleNotFoundError: No module named 'sklearn'

After pip install scikit-learn:

ModuleNotFoundError                       Traceback (most recent call last)
Cell In[1], line 7
      5 archive = parse('vasprun.xml')
      6 # run all normalizers
----> 7 normalize_all(archive)
      9 # get the 'main section' section_run as a metainfo object
     10 section_run = archive.run[0]

File /mnt/c/Users/asros/github/nomad/nomad/client/processing.py:94, in normalize_all(entry_archive, logger)
     90 def normalize_all(entry_archive, logger=None):
     91     '''
     92     Parse the downloaded entry and run the whole normalizer chain.
     93     '''
---> 94     from nomad import normalizing
     96     for normalizer in normalizing.normalizers:
     97         if normalizer.domain is None or normalizer.domain == entry_archive.metadata.domain:

File /mnt/c/Users/asros/github/nomad/nomad/normalizing/__init__.py:41
     19 '''
     20 After parsing entries have to be normalized with a set of *normalizers*.
     21 In NOMAD-coe those were programmed in python (we'll reuse) and scala (we'll rewrite).
   (...)
     36     :members:
     37 '''
     39 from typing import List, Any, Iterable, Type
---> 41 from .system import SystemNormalizer
     42 from .optimade import OptimadeNormalizer
     43 from .dos import DosNormalizer

File /mnt/c/Users/asros/github/nomad/nomad/normalizing/system.py:29
     26 from matid import SymmetryAnalyzer, Classifier  # pylint: disable=import-error
     27 from matid.classifications import Class0D, Atom, Class1D, Material2D, Surface, Class3D  # pylint: disable=import-error
---> 29 from nomad import atomutils, archive
     30 from nomad.atomutils import Formula
     31 from nomad.units import ureg

File /mnt/c/Users/asros/github/nomad/nomad/archive/__init__.py:40
     36 from .storage import (
     37     serialise_container, write_archive, read_archive, ArchiveError, ArchiveReader, ArchiveWriter,
     38     ArchiveDict, ArchiveList, ArchiveItem)
     39 from .query import query_archive, filter_archive, ArchiveQueryError
---> 40 from .partial import (
     41     read_partial_archive_from_mongo, read_partial_archives_from_mongo,
     42     write_partial_archive_to_mongo, delete_partial_archives_from_mongo,
     43     create_partial_archive, compute_required_with_referenced)
     44 from .required import RequiredReader, RequiredValidationError

File /mnt/c/Users/asros/github/nomad/nomad/archive/partial.py:21
      1 #
      2 # Copyright The NOMAD Authors.
      3 #
   (...)
     16 # limitations under the License.
     17 #
     19 from typing import Any, Tuple, Dict, Union, List
---> 21 from nomad import infrastructure, config
     22 from nomad.metainfo import MSection, Definition, Quantity, Reference, SubSection, Section
     23 from nomad.datamodel import EntryArchive

File /mnt/c/Users/asros/github/nomad/nomad/infrastructure.py:30
     28 import shutil
     29 from elasticsearch_dsl import connections
---> 30 from mongoengine import connect, disconnect
     31 from mongoengine.connection import ConnectionFailure
     32 import smtplib

ModuleNotFoundError: No module named 'mongoengine'

After pip install mongoengine:

ModuleNotFoundError                       Traceback (most recent call last)
Cell In[1], line 5
      2 from nomad.client import parse, normalize_all
      4 archive = parse('vasprun.xml')
----> 5 normalize_all(archive)
      6 section_run = archive.run[0]
      7 python_dict = section_run.m_to_dict()

File /mnt/c/Users/asros/github/nomad/nomad/client/processing.py:94, in normalize_all(entry_archive, logger)
     90 def normalize_all(entry_archive, logger=None):
     91     '''
     92     Parse the downloaded entry and run the whole normalizer chain.
     93     '''
---> 94     from nomad import normalizing
     96     for normalizer in normalizing.normalizers:
     97         if normalizer.domain is None or normalizer.domain == entry_archive.metadata.domain:

File /mnt/c/Users/asros/github/nomad/nomad/normalizing/__init__.py:41
     19 '''
     20 After parsing entries have to be normalized with a set of *normalizers*.
     21 In NOMAD-coe those were programmed in python (we'll reuse) and scala (we'll rewrite).
   (...)
     36     :members:
     37 '''
     39 from typing import List, Any, Iterable, Type
---> 41 from .system import SystemNormalizer
     42 from .optimade import OptimadeNormalizer
     43 from .dos import DosNormalizer

File /mnt/c/Users/asros/github/nomad/nomad/normalizing/system.py:29
     26 from matid import SymmetryAnalyzer, Classifier  # pylint: disable=import-error
     27 from matid.classifications import Class0D, Atom, Class1D, Material2D, Surface, Class3D  # pylint: disable=import-error
---> 29 from nomad import atomutils, archive
     30 from nomad.atomutils import Formula
     31 from nomad.units import ureg

File /mnt/c/Users/asros/github/nomad/nomad/archive/__init__.py:40
     36 from .storage import (
     37     serialise_container, write_archive, read_archive, ArchiveError, ArchiveReader, ArchiveWriter,
     38     ArchiveDict, ArchiveList, ArchiveItem)
     39 from .query import query_archive, filter_archive, ArchiveQueryError
---> 40 from .partial import (
     41     read_partial_archive_from_mongo, read_partial_archives_from_mongo,
     42     write_partial_archive_to_mongo, delete_partial_archives_from_mongo,
     43     create_partial_archive, compute_required_with_referenced)
     44 from .required import RequiredReader, RequiredValidationError

File /mnt/c/Users/asros/github/nomad/nomad/archive/partial.py:21
      1 #
      2 # Copyright The NOMAD Authors.
      3 #
   (...)
     16 # limitations under the License.
     17 #
     19 from typing import Any, Tuple, Dict, Union, List
---> 21 from nomad import infrastructure, config
     22 from nomad.metainfo import MSection, Definition, Quantity, Reference, SubSection, Section
     23 from nomad.datamodel import EntryArchive

File /mnt/c/Users/asros/github/nomad/nomad/infrastructure.py:37
     35 from keycloak.exceptions import KeycloakAuthenticationError, KeycloakGetError
     36 import json
---> 37 import jwt
     38 from datetime import datetime
     39 import re

ModuleNotFoundError: No module named 'jwt'

After pip install jwt:

ModuleNotFoundError                       Traceback (most recent call last)
Cell In[1], line 5
      2 from nomad.client import parse, normalize_all
      4 archive = parse('vasprun.xml')
----> 5 normalize_all(archive)
      6 section_run = archive.run[0]
      7 python_dict = section_run.m_to_dict()

File /mnt/c/Users/asros/github/nomad/nomad/client/processing.py:94, in normalize_all(entry_archive, logger)
     90 def normalize_all(entry_archive, logger=None):
     91     '''
     92     Parse the downloaded entry and run the whole normalizer chain.
     93     '''
---> 94     from nomad import normalizing
     96     for normalizer in normalizing.normalizers:
     97         if normalizer.domain is None or normalizer.domain == entry_archive.metadata.domain:

File /mnt/c/Users/asros/github/nomad/nomad/normalizing/__init__.py:41
     19 '''
     20 After parsing entries have to be normalized with a set of *normalizers*.
     21 In NOMAD-coe those were programmed in python (we'll reuse) and scala (we'll rewrite).
   (...)
     36     :members:
     37 '''
     39 from typing import List, Any, Iterable, Type
---> 41 from .system import SystemNormalizer
     42 from .optimade import OptimadeNormalizer
     43 from .dos import DosNormalizer

File /mnt/c/Users/asros/github/nomad/nomad/normalizing/system.py:29
     26 from matid import SymmetryAnalyzer, Classifier  # pylint: disable=import-error
     27 from matid.classifications import Class0D, Atom, Class1D, Material2D, Surface, Class3D  # pylint: disable=import-error
---> 29 from nomad import atomutils, archive
     30 from nomad.atomutils import Formula
     31 from nomad.units import ureg

File /mnt/c/Users/asros/github/nomad/nomad/archive/__init__.py:40
     36 from .storage import (
     37     serialise_container, write_archive, read_archive, ArchiveError, ArchiveReader, ArchiveWriter,
     38     ArchiveDict, ArchiveList, ArchiveItem)
     39 from .query import query_archive, filter_archive, ArchiveQueryError
---> 40 from .partial import (
     41     read_partial_archive_from_mongo, read_partial_archives_from_mongo,
     42     write_partial_archive_to_mongo, delete_partial_archives_from_mongo,
     43     create_partial_archive, compute_required_with_referenced)
     44 from .required import RequiredReader, RequiredValidationError

File /mnt/c/Users/asros/github/nomad/nomad/archive/partial.py:21
      1 #
      2 # Copyright The NOMAD Authors.
      3 #
   (...)
     16 # limitations under the License.
     17 #
     19 from typing import Any, Tuple, Dict, Union, List
---> 21 from nomad import infrastructure, config
     22 from nomad.metainfo import MSection, Definition, Quantity, Reference, SubSection, Section
     23 from nomad.datamodel import EntryArchive

File /mnt/c/Users/asros/github/nomad/nomad/infrastructure.py:40
     38 from datetime import datetime
     39 import re
---> 40 import unidecode
     42 from nomad import config, utils
     43 from nomad.utils.structlogging import get_logger

ModuleNotFoundError: No module named 'unidecode'

AFter pip install unidecode:

ModuleNotFoundError                       Traceback (most recent call last)
Cell In[1], line 5
      2 from nomad.client import parse, normalize_all
      4 archive = parse('vasprun.xml')
----> 5 normalize_all(archive)
      6 section_run = archive.run[0]
      7 python_dict = section_run.m_to_dict()

File /mnt/c/Users/asros/github/nomad/nomad/client/processing.py:94, in normalize_all(entry_archive, logger)
     90 def normalize_all(entry_archive, logger=None):
     91     '''
     92     Parse the downloaded entry and run the whole normalizer chain.
     93     '''
---> 94     from nomad import normalizing
     96     for normalizer in normalizing.normalizers:
     97         if normalizer.domain is None or normalizer.domain == entry_archive.metadata.domain:

File /mnt/c/Users/asros/github/nomad/nomad/normalizing/__init__.py:41
     19 '''
     20 After parsing entries have to be normalized with a set of *normalizers*.
     21 In NOMAD-coe those were programmed in python (we'll reuse) and scala (we'll rewrite).
   (...)
     36     :members:
     37 '''
     39 from typing import List, Any, Iterable, Type
---> 41 from .system import SystemNormalizer
     42 from .optimade import OptimadeNormalizer
     43 from .dos import DosNormalizer

File /mnt/c/Users/asros/github/nomad/nomad/normalizing/system.py:29
     26 from matid import SymmetryAnalyzer, Classifier  # pylint: disable=import-error
     27 from matid.classifications import Class0D, Atom, Class1D, Material2D, Surface, Class3D  # pylint: disable=import-error
---> 29 from nomad import atomutils, archive
     30 from nomad.atomutils import Formula
     31 from nomad.units import ureg

File /mnt/c/Users/asros/github/nomad/nomad/archive/__init__.py:40
     36 from .storage import (
     37     serialise_container, write_archive, read_archive, ArchiveError, ArchiveReader, ArchiveWriter,
     38     ArchiveDict, ArchiveList, ArchiveItem)
     39 from .query import query_archive, filter_archive, ArchiveQueryError
---> 40 from .partial import (
     41     read_partial_archive_from_mongo, read_partial_archives_from_mongo,
     42     write_partial_archive_to_mongo, delete_partial_archives_from_mongo,
     43     create_partial_archive, compute_required_with_referenced)
     44 from .required import RequiredReader, RequiredValidationError

File /mnt/c/Users/asros/github/nomad/nomad/archive/partial.py:21
      1 #
      2 # Copyright The NOMAD Authors.
      3 #
   (...)
     16 # limitations under the License.
     17 #
     19 from typing import Any, Tuple, Dict, Union, List
---> 21 from nomad import infrastructure, config
     22 from nomad.metainfo import MSection, Definition, Quantity, Reference, SubSection, Section
     23 from nomad.datamodel import EntryArchive

File /mnt/c/Users/asros/github/nomad/nomad/infrastructure.py:43
     40 import unidecode
     42 from nomad import config, utils
---> 43 from nomad.utils.structlogging import get_logger
     45 # The metainfo is defined and used during imports. This is problematic.
     46 # We import all parsers very early in the infrastructure setup. This will populate
     47 # the metainfo with parser specific definitions, before the metainfo might be used.
     48 from nomad.parsing import parsers  # pylint: disable=unused-import

File /mnt/c/Users/asros/github/nomad/nomad/utils/structlogging.py:42
     40 from typing import cast, Any
     41 import logging
---> 42 import structlog
     43 from structlog.processors import StackInfoRenderer, format_exc_info, TimeStamper, JSONRenderer
     44 from structlog.stdlib import LoggerFactory

ModuleNotFoundError: No module named 'structlog'

After `pip install structlog`:

```python
ModuleNotFoundError                       Traceback (most recent call last)
Cell In[1], line 5
      2 from nomad.client import parse, normalize_all
      4 archive = parse('vasprun.xml')
----> 5 normalize_all(archive)
      6 section_run = archive.run[0]
      7 python_dict = section_run.m_to_dict()

File /mnt/c/Users/asros/github/nomad/nomad/client/processing.py:94, in normalize_all(entry_archive, logger)
     90 def normalize_all(entry_archive, logger=None):
     91     '''
     92     Parse the downloaded entry and run the whole normalizer chain.
     93     '''
---> 94     from nomad import normalizing
     96     for normalizer in normalizing.normalizers:
     97         if normalizer.domain is None or normalizer.domain == entry_archive.metadata.domain:

File /mnt/c/Users/asros/github/nomad/nomad/normalizing/__init__.py:41
     19 '''
     20 After parsing entries have to be normalized with a set of *normalizers*.
     21 In NOMAD-coe those were programmed in python (we'll reuse) and scala (we'll rewrite).
   (...)
     36     :members:
     37 '''
     39 from typing import List, Any, Iterable, Type
---> 41 from .system import SystemNormalizer
     42 from .optimade import OptimadeNormalizer
     43 from .dos import DosNormalizer

File /mnt/c/Users/asros/github/nomad/nomad/normalizing/system.py:29
     26 from matid import SymmetryAnalyzer, Classifier  # pylint: disable=import-error
     27 from matid.classifications import Class0D, Atom, Class1D, Material2D, Surface, Class3D  # pylint: disable=import-error
---> 29 from nomad import atomutils, archive
     30 from nomad.atomutils import Formula
     31 from nomad.units import ureg

File /mnt/c/Users/asros/github/nomad/nomad/archive/__init__.py:40
     36 from .storage import (
     37     serialise_container, write_archive, read_archive, ArchiveError, ArchiveReader, ArchiveWriter,
     38     ArchiveDict, ArchiveList, ArchiveItem)
     39 from .query import query_archive, filter_archive, ArchiveQueryError
---> 40 from .partial import (
     41     read_partial_archive_from_mongo, read_partial_archives_from_mongo,
     42     write_partial_archive_to_mongo, delete_partial_archives_from_mongo,
     43     create_partial_archive, compute_required_with_referenced)
     44 from .required import RequiredReader, RequiredValidationError

File /mnt/c/Users/asros/github/nomad/nomad/archive/partial.py:21
      1 #
      2 # Copyright The NOMAD Authors.
      3 #
   (...)
     16 # limitations under the License.
     17 #
     19 from typing import Any, Tuple, Dict, Union, List
---> 21 from nomad import infrastructure, config
     22 from nomad.metainfo import MSection, Definition, Quantity, Reference, SubSection, Section
     23 from nomad.datamodel import EntryArchive

File /mnt/c/Users/asros/github/nomad/nomad/infrastructure.py:43
     40 import unidecode
     42 from nomad import config, utils
---> 43 from nomad.utils.structlogging import get_logger
     45 # The metainfo is defined and used during imports. This is problematic.
     46 # We import all parsers very early in the infrastructure setup. This will populate
     47 # the metainfo with parser specific definitions, before the metainfo might be used.
     48 from nomad.parsing import parsers  # pylint: disable=unused-import

File /mnt/c/Users/asros/github/nomad/nomad/utils/structlogging.py:45
     43 from structlog.processors import StackInfoRenderer, format_exc_info, TimeStamper, JSONRenderer
     44 from structlog.stdlib import LoggerFactory
---> 45 import logstash
     46 from contextlib import contextmanager
     47 import json

ModuleNotFoundError: No module named 'logstash'

After pip install python-logstash:

ModuleNotFoundError                       Traceback (most recent call last)
Cell In[1], line 5
      2 from nomad.client import parse, normalize_all
      4 archive = parse('vasprun.xml')
----> 5 normalize_all(archive)
      6 section_run = archive.run[0]
      7 python_dict = section_run.m_to_dict()

File /mnt/c/Users/asros/github/nomad/nomad/client/processing.py:94, in normalize_all(entry_archive, logger)
     90 def normalize_all(entry_archive, logger=None):
     91     '''
     92     Parse the downloaded entry and run the whole normalizer chain.
     93     '''
---> 94     from nomad import normalizing
     96     for normalizer in normalizing.normalizers:
     97         if normalizer.domain is None or normalizer.domain == entry_archive.metadata.domain:

File /mnt/c/Users/asros/github/nomad/nomad/normalizing/__init__.py:41
     19 '''
     20 After parsing entries have to be normalized with a set of *normalizers*.
     21 In NOMAD-coe those were programmed in python (we'll reuse) and scala (we'll rewrite).
   (...)
     36     :members:
     37 '''
     39 from typing import List, Any, Iterable, Type
---> 41 from .system import SystemNormalizer
     42 from .optimade import OptimadeNormalizer
     43 from .dos import DosNormalizer

File /mnt/c/Users/asros/github/nomad/nomad/normalizing/system.py:29
     26 from matid import SymmetryAnalyzer, Classifier  # pylint: disable=import-error
     27 from matid.classifications import Class0D, Atom, Class1D, Material2D, Surface, Class3D  # pylint: disable=import-error
---> 29 from nomad import atomutils, archive
     30 from nomad.atomutils import Formula
     31 from nomad.units import ureg

File /mnt/c/Users/asros/github/nomad/nomad/archive/__init__.py:44
     39 from .query import query_archive, filter_archive, ArchiveQueryError
     40 from .partial import (
     41     read_partial_archive_from_mongo, read_partial_archives_from_mongo,
     42     write_partial_archive_to_mongo, delete_partial_archives_from_mongo,
     43     create_partial_archive, compute_required_with_referenced)
---> 44 from .required import RequiredReader, RequiredValidationError

File /mnt/c/Users/asros/github/nomad/nomad/archive/required.py:24
     21 from typing import cast, Union, Dict, Tuple, Any
     23 from cachetools.func import lru_cache
---> 24 from fastapi import HTTPException
     26 from nomad import utils
     27 from nomad.metainfo import Definition, Section, Quantity, SubSection, Reference, QuantityReference

ModuleNotFoundError: No module named 'fastapi'

After pip install fastapi:

AttributeError                            Traceback (most recent call last)
Cell In[1], line 5
      2 from nomad.client import parse, normalize_all
      4 archive = parse('vasprun.xml')
----> 5 normalize_all(archive)
      6 section_run = archive.run[0]
      7 python_dict = section_run.m_to_dict()

File /mnt/c/Users/asros/github/nomad/nomad/client/processing.py:97, in normalize_all(entry_archive, logger)
     94 from nomad import normalizing
     96 for normalizer in normalizing.normalizers:
---> 97     if normalizer.domain is None or normalizer.domain == entry_archive.metadata.domain:
     98         normalize(normalizer, entry_archive, logger=logger)

AttributeError: 'list' object has no attribute 'metadata'

And this is where I stopped since I wasn't sure how to resolve it.

TLCFEM commented 1 year ago

Looks like normalisers introduce too many dependencies, which needs to be addressed.

AttributeError: 'list' object has no attribute 'metadata'

For this one, parse returns a list, but not sure why the doc does not pick this up. Just change section_run = archive.run[0] to section_run = archive[0].run[0], shall work for the file provided.

Andrew-S-Rosen commented 1 year ago

Thanks!

I don't think that solves it because the error happens in normalize_all before the section_run. Doing archive.metadata returns the same error. Here is the archive list: [EntryArchive(run, workflow, workflow2, metadata)].

AttributeError                            Traceback (most recent call last)
Cell In[66], line 4
      1 from nomad.client import parse, normalize_all
      3 archive = parse('vasprun.xml')
----> 4 normalize_all(archive)
      5 section_run = archive[0].run[0]
      6 python_dict = section_run.m_to_dict()

File /mnt/c/Users/asros/github/nomad/nomad/client/processing.py:97, in normalize_all(entry_archive, logger)
     94 from nomad import normalizing
     96 for normalizer in normalizing.normalizers:
---> 97     if normalizer.domain is None or normalizer.domain == entry_archive.metadata.domain:
     98         normalize(normalizer, entry_archive, logger=logger)

AttributeError: 'list' object has no attribute 'metadata'
TLCFEM commented 1 year ago

You are very correct, I meant archive = parse('vasprun.xml') to archive = parse('vasprun.xml')[0].

Andrew-S-Rosen commented 1 year ago

Beautiful! Yes, that does indeed make more sense. I got output! Thanks for the help and apologies for some of my own confusion to start off.

TLCFEM commented 1 year ago

The doc somehow just cannot keep up with the changes, I'll update that for the moment.

Dependency issue linked: https://gitlab.mpcdf.mpg.de/nomad-lab/nomad-FAIR/-/issues/1423

lauri-codes commented 1 year ago

Thanks @arosen93 for the feedback. Indeed we need to update the docs and sort out the dependencies for local parsing.

markus1978 commented 11 months ago

We published nomad-lab==1.2.0 to PyPI. The imports and dependencies have been fixed. The requirements are much more unrestrictive and should make it easier to install the package in different environments. There also have been updates to the documentation. The guide to use parser can be found here: https://nomad-lab.eu/prod/v1/staging/docs/apis/local_parsers.html