From 45b40b0786f422e4fc1c918d5c0b5ebf5fdde289 Mon Sep 17 00:00:00 2001 From: ndaelman Date: Wed, 13 Nov 2024 16:14:34 +0100 Subject: [PATCH 1/6] Relax dependencies --- pyproject.toml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index bf32dd31..a48035cd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,12 +27,12 @@ homepage = "https://github.com/nomad-coe/electronic-parsers" [project.optional-dependencies] dev = [ 'mypy==1.0.1', - 'pytest==3.10.0', - 'pytest-timeout==1.4.2', - 'pytest-cov==2.7.1', + 'pytest>= 5.3.0, <8', + 'pytest-timeout>=1.4.2', + 'pytest-cov>=2.7.1', 'astroid==2.11.7', - 'typing-extensions==4.7.1', - 'ruff==0.1.8' + 'typing-extensions>=4.12', + 'ruff>=0.6' ] # these are extra deps for nomad infra as a result of using nomad.search # TODO remove usage in magres and w2dynamics From 2b33e737f62dcd0b2ed7d77094bddb85691717ec Mon Sep 17 00:00:00 2001 From: ndaelman Date: Wed, 13 Nov 2024 16:16:48 +0100 Subject: [PATCH 2/6] apply alphabetical ordering to dependencies --- pyproject.toml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index a48035cd..16735c9c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,13 +10,13 @@ readme = "README.md" authors = [{ name = "The NOMAD Authors" }] license = { file = "LICENSE" } dependencies = [ + "h5py>=3.6.0", + "lxml>=5.2", "nomad-lab>=1.3.6.dev1", "nomad-schema-plugin-simulation-workflow>=1.0.1", "nomad-schema-plugin-run>=1.0.1", "nomad-parser-plugins-simulation>=1.0.2", - "lxml>=5.2", "netCDF4==1.6.5", - "h5py>=3.6.0", "pyyaml>=6.0", "pydantic>=1.10.8,<2.0.0", ] @@ -26,25 +26,25 @@ homepage = "https://github.com/nomad-coe/electronic-parsers" [project.optional-dependencies] dev = [ + 'astroid==2.11.7', 'mypy==1.0.1', 'pytest>= 5.3.0, <8', 'pytest-timeout>=1.4.2', 'pytest-cov>=2.7.1', - 'astroid==2.11.7', + 'ruff>=0.6', 'typing-extensions>=4.12', - 'ruff>=0.6' ] # these are extra deps for nomad infra as a result of using nomad.search # TODO remove usage in magres and w2dynamics infrastructure = [ + "elasticsearch==7.17.1", + "elasticsearch-dsl==7.4.0", + "fastapi<0.100", "mongoengine>=0.20", "pyjwt[crypto]==2.6.0", - "structlog", "python-logstash==0.4.6", "pydantic>=1.10.8,<2.0.0", - "fastapi<0.100", - "elasticsearch==7.17.1", - "elasticsearch-dsl==7.4.0", + "structlog", "zipstream-new==1.1.5", ] From 06c6530b043933e14ed717eb7f7d90015d3a63f6 Mon Sep 17 00:00:00 2001 From: ndaelman Date: Wed, 13 Nov 2024 16:32:30 +0100 Subject: [PATCH 3/6] Remove deprecated imports for the magres parser --- electronicparsers/magres/parser.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/electronicparsers/magres/parser.py b/electronicparsers/magres/parser.py index 5426e3fa..8e742311 100644 --- a/electronicparsers/magres/parser.py +++ b/electronicparsers/magres/parser.py @@ -40,9 +40,6 @@ ElectricFieldGradient, SpinSpinCoupling, ) -from .metainfo.magres import m_package - -from nomad.app.v1.models import MetadataRequired from ..utils import BeyondDFTWorkflowsParser From fdae671446763e42b6923e24a6dc90fcbaf3f6d7 Mon Sep 17 00:00:00 2001 From: ndaelman Date: Wed, 13 Nov 2024 17:07:58 +0100 Subject: [PATCH 4/6] Shift dependencies to nomadlab[infrastructure] --- pyproject.toml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 16735c9c..1348611d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,15 +37,8 @@ dev = [ # these are extra deps for nomad infra as a result of using nomad.search # TODO remove usage in magres and w2dynamics infrastructure = [ - "elasticsearch==7.17.1", - "elasticsearch-dsl==7.4.0", - "fastapi<0.100", "mongoengine>=0.20", - "pyjwt[crypto]==2.6.0", - "python-logstash==0.4.6", - "pydantic>=1.10.8,<2.0.0", - "structlog", - "zipstream-new==1.1.5", + "nomad-lab[infrastructure]>=1.3.10", ] [tool.ruff] From e26e7ba8701b9557ebb0d2696394ceb52941d249 Mon Sep 17 00:00:00 2001 From: ndaelman Date: Thu, 14 Nov 2024 15:39:32 +0100 Subject: [PATCH 5/6] Reintroduce `m_package` --- electronicparsers/magres/parser.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/electronicparsers/magres/parser.py b/electronicparsers/magres/parser.py index 8e742311..06902c84 100644 --- a/electronicparsers/magres/parser.py +++ b/electronicparsers/magres/parser.py @@ -40,6 +40,7 @@ ElectricFieldGradient, SpinSpinCoupling, ) +from .metainfo.magres import m_package from ..utils import BeyondDFTWorkflowsParser @@ -438,7 +439,7 @@ def parse(self, filepath, archive, logger): # Create Run with Program information sec_run = Run() - calculation_params = self.magres_file_parser.get('calculation') + calculation_params = self.magres_file_parser.get('calculation', {}) program_name = calculation_params.get('code', '') if program_name != 'CASTEP': self.logger.error( From 5aea01f4239b811eb6b9be5459b416521e168390 Mon Sep 17 00:00:00 2001 From: ndaelman Date: Thu, 14 Nov 2024 15:56:39 +0100 Subject: [PATCH 6/6] Follow NOMAD specification of `mongoengine` --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 1348611d..9bfafa1a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,7 +37,6 @@ dev = [ # these are extra deps for nomad infra as a result of using nomad.search # TODO remove usage in magres and w2dynamics infrastructure = [ - "mongoengine>=0.20", "nomad-lab[infrastructure]>=1.3.10", ]