Commit fc8f994b authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Merge branch 'v0.10.6' into 'master'

Hotfix for v0.10.6: broken provider specific optimade properties

See merge request !380
parents b5042df7 8842e4a1
Pipeline #109325 passed with stage
in 17 seconds
......@@ -15,14 +15,20 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
from typing import Tuple, Generator
from typing import Tuple, Generator, cast
from nomad.metainfo.metainfo import Quantity, Reference
from nomad.metainfo.search_extension import Search
from nomad.search import search_quantities
def provider_specific_fields() -> Generator[Tuple[str, Search], None, None]:
for search_quantity in search_quantities.values():
quantity = cast(Quantity, search_quantity.definition)
if isinstance(quantity.type, Reference):
# we can't yet support those
continue
nmd_name = search_quantity.qualified_name
nmd_name_split = nmd_name.split('.')
......
......@@ -414,12 +414,12 @@ class MaterialBulkNormalizer(MaterialNormalizer):
self.crystal_system(bulk, sec_symmetry)
self.lattice_vectors_primitive(ideal, prim_atoms)
self.formula(material, names, counts)
self.formula_reduced(material, names, reduced_counts)
self.formula_reduced(material, names, reduced_counts) # type: ignore
self.species(material, names)
self.species_and_counts(material, names, reduced_counts)
self.species_and_counts(material, names, reduced_counts) # type: ignore
self.has_free_wyckoff_parameters(bulk, symmetry_analyzer)
self.lattice_parameters(ideal, std_atoms)
self.material_name(material, names, reduced_counts)
self.material_name(material, names, reduced_counts) # type: ignore
self.material_classification(material, sec_system)
self.periodicity(ideal)
self.point_group(bulk, sec_symmetry)
......@@ -538,9 +538,9 @@ class Material2DNormalizer(MaterialNormalizer):
self.lattice_vectors(ideal, std_atoms)
self.lattice_vectors_primitive(ideal, prim_atoms)
self.formula(material, names, counts)
self.formula_reduced(material, names, reduced_counts)
self.formula_reduced(material, names, reduced_counts) # type: ignore
self.species(material, names)
self.species_and_counts(material, names, reduced_counts)
self.species_and_counts(material, names, reduced_counts) # type: ignore
self.lattice_parameters(ideal, std_atoms, ideal.periodicity)
......@@ -755,8 +755,8 @@ class Material1DNormalizer(MaterialNormalizer):
self.atom_positions(ideal, std_atoms)
self.lattice_vectors(ideal, std_atoms)
self.formula(material, names, counts)
self.formula_reduced(material, names, reduced_counts)
self.formula_reduced(material, names, reduced_counts) # type: ignore
self.species(material, names)
self.species_and_counts(material, names, reduced_counts)
self.species_and_counts(material, names, reduced_counts) # type: ignore
self.material_id_1d(material, std_atoms)
self.lattice_parameters(ideal, std_atoms, ideal.periodicity)
......@@ -127,12 +127,12 @@ class MethodNormalizer():
atom_positions = sec_sys['atom_positions']
geom_dict['atom_positions'] = np.array2string(
atom_positions.to(ureg.angstrom).magnitude, # convert to Angstrom
formatter={'float_kind': lambda x: "%.6f" % x},
formatter={'float_kind': lambda x: "%.6f" % x}, # type: ignore
).replace('\n', '')
cell = sec_sys['lattice_vectors']
geom_dict['simulation_cell'] = np.array2string(
cell.to(ureg.angstrom).magnitude, # convert to Angstrom
formatter={'float_kind': lambda x: "%.6f" % x},
formatter={'float_kind': lambda x: "%.6f" % x}, # type: ignore
).replace('\n', '')
param_dict['settings_geometry'] = geom_dict
......
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