Commit 0b43b253 authored by Alvin Noe Ladines's avatar Alvin Noe Ladines
Browse files

Linting fixes

parent 08a3f62c
Pipeline #101822 passed with stages
in 24 minutes and 25 seconds
Subproject commit 164d8567dfdee9bdeae752e30f7fef80623abb8e Subproject commit 2e92ba01c0e62ad9e6cb8b44cefc0e2391b67a3f
...@@ -44,10 +44,7 @@ class AllMetainfoResource(Resource): ...@@ -44,10 +44,7 @@ class AllMetainfoResource(Resource):
''' '''
Returns all metainfo packages. Returns all metainfo packages.
''' '''
# Ensure all metainfo is loaded _ = [parser for parser in parsers]
for parser in parsers:
_ = parser.metainfo_env
return { return {
key: value.m_to_dict() key: value.m_to_dict()
for key, value in Package.registry.items()} for key, value in Package.registry.items()}
......
...@@ -80,7 +80,6 @@ def metainfo_undecorated(): ...@@ -80,7 +80,6 @@ def metainfo_undecorated():
import nomad.datamodel.ems import nomad.datamodel.ems
import nomad.datamodel.optimade import nomad.datamodel.optimade
import nomad.datamodel.encyclopedia import nomad.datamodel.encyclopedia
from nomad.parsing import LegacyParser
nomad.metainfo.metainfo.m_package.__init_metainfo__() nomad.metainfo.metainfo.m_package.__init_metainfo__()
nomad.datamodel.datamodel.m_package.__init_metainfo__() nomad.datamodel.datamodel.m_package.__init_metainfo__()
nomad.datamodel.dft.m_package.__init_metainfo__() # pylint: disable=no-member nomad.datamodel.dft.m_package.__init_metainfo__() # pylint: disable=no-member
...@@ -88,12 +87,6 @@ def metainfo_undecorated(): ...@@ -88,12 +87,6 @@ def metainfo_undecorated():
nomad.datamodel.optimade.m_package.__init_metainfo__() # pylint: disable=no-member nomad.datamodel.optimade.m_package.__init_metainfo__() # pylint: disable=no-member
nomad.datamodel.encyclopedia.m_package.__init_metainfo__() nomad.datamodel.encyclopedia.m_package.__init_metainfo__()
# Ensure all parser metainfo is loaded
from nomad.parsing.parsers import parsers
for parser in parsers:
if isinstance(parser, LegacyParser):
_ = parser.metainfo_env
export = Environment() export = Environment()
for package in Package.registry.values(): for package in Package.registry.values():
export.m_add_sub_section(Environment.packages, package) export.m_add_sub_section(Environment.packages, package)
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
from typing import Any, Dict from typing import Any, Dict
from nptyping import NDArray from nptyping import NDArray
from collections import Counter
import ase import ase
from ase import Atoms from ase import Atoms
import numpy as np import numpy as np
...@@ -59,8 +58,7 @@ def formula_normalizer(atoms): ...@@ -59,8 +58,7 @@ def formula_normalizer(atoms):
e.g., Tc -> Tc100, SZn -> S50Zn50, Co2Nb -> Co67Nb33 e.g., Tc -> Tc100, SZn -> S50Zn50, Co2Nb -> Co67Nb33
''' '''
# #
chem_symb = atoms.get_chemical_symbols() atoms_counter = atoms.symbols.formula.count() # dictionary
atoms_counter = Counter(chem_symb) # dictionary
atoms_total = sum(atoms_counter.values()) atoms_total = sum(atoms_counter.values())
atoms_normed = [] atoms_normed = []
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment