From ce3c99dbc57853d955940cdd57b83f63bc1bd6eb Mon Sep 17 00:00:00 2001 From: Sebastiaan Huber Date: Fri, 27 Oct 2023 19:17:07 +0200 Subject: [PATCH] Devops: Address various deprecation warnings from `aiida-core` --- src/aiida_quantumespresso/workflows/xps.py | 2 +- src/aiida_quantumespresso/workflows/xspectra/crystal.py | 2 +- tests/parsers/test_neb.py | 4 ++-- tests/parsers/test_open_grid.py | 4 ++-- tests/parsers/test_ph.py | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/aiida_quantumespresso/workflows/xps.py b/src/aiida_quantumespresso/workflows/xps.py index 1f6491456..a30ce5347 100644 --- a/src/aiida_quantumespresso/workflows/xps.py +++ b/src/aiida_quantumespresso/workflows/xps.py @@ -21,7 +21,7 @@ PwCalculation = CalculationFactory('quantumespresso.pw') PwBaseWorkChain = WorkflowFactory('quantumespresso.pw.base') PwRelaxWorkChain = WorkflowFactory('quantumespresso.pw.relax') -XyData = DataFactory('array.xy') +XyData = DataFactory('core.array.xy') def validate_inputs(inputs, _): diff --git a/src/aiida_quantumespresso/workflows/xspectra/crystal.py b/src/aiida_quantumespresso/workflows/xspectra/crystal.py index d2b851af4..1798ba2da 100644 --- a/src/aiida_quantumespresso/workflows/xspectra/crystal.py +++ b/src/aiida_quantumespresso/workflows/xspectra/crystal.py @@ -19,7 +19,7 @@ PwRelaxWorkChain = WorkflowFactory('quantumespresso.pw.relax') XspectraBaseWorkChain = WorkflowFactory('quantumespresso.xspectra.base') XspectraCoreWorkChain = WorkflowFactory('quantumespresso.xspectra.core') -XyData = DataFactory('array.xy') +XyData = DataFactory('core.array.xy') class XspectraCrystalWorkChain(ProtocolMixin, WorkChain): diff --git a/tests/parsers/test_neb.py b/tests/parsers/test_neb.py index 4053a4c55..988d002c2 100644 --- a/tests/parsers/test_neb.py +++ b/tests/parsers/test_neb.py @@ -57,7 +57,7 @@ def test_neb_default(fixture_localhost, generate_calc_job_node, generate_parser, assert calcfunction.is_finished, calcfunction.exception assert calcfunction.is_finished_ok, calcfunction.exit_message - assert not [log for log in orm.Log.objects.get_logs_for(node) if log.levelname == 'ERROR'] + assert not [log for log in orm.Log.collection.get_logs_for(node) if log.levelname == 'ERROR'] assert 'output_parameters' in results assert 'output_mep' in results assert 'output_trajectory' in results @@ -89,7 +89,7 @@ def test_neb_all_iterations( assert calcfunction.is_finished, calcfunction.exception assert calcfunction.is_finished_ok, calcfunction.exit_message - assert not [log for log in orm.Log.objects.get_logs_for(node) if log.levelname == 'ERROR'] + assert not [log for log in orm.Log.collection.get_logs_for(node) if log.levelname == 'ERROR'] assert 'output_parameters' in results assert 'output_mep' in results assert 'output_trajectory' in results diff --git a/tests/parsers/test_open_grid.py b/tests/parsers/test_open_grid.py index 3438a70af..b14388426 100644 --- a/tests/parsers/test_open_grid.py +++ b/tests/parsers/test_open_grid.py @@ -20,8 +20,8 @@ def test_open_grid_default(fixture_localhost, generate_calc_job_node, generate_p data_regression.check({ 'output_parameters': results['output_parameters'].get_dict(), - 'kpoints_mesh': results['kpoints_mesh'].attributes, - 'kpoints': results['kpoints'].attributes, + 'kpoints_mesh': results['kpoints_mesh'].base.attributes.all, + 'kpoints': results['kpoints'].base.attributes.all, }) num_regression.check({ diff --git a/tests/parsers/test_ph.py b/tests/parsers/test_ph.py index fcf13e60b..25a5a64fc 100644 --- a/tests/parsers/test_ph.py +++ b/tests/parsers/test_ph.py @@ -22,7 +22,7 @@ def test_ph_default(test_name, fixture_localhost, generate_calc_job_node, genera assert calcfunction.is_finished, calcfunction.exception assert calcfunction.is_finished_ok, calcfunction.exit_message - assert not [log for log in orm.Log.objects.get_logs_for(node) if log.levelname == 'ERROR'] + assert not [log for log in orm.Log.collection.get_logs_for(node) if log.levelname == 'ERROR'] assert 'output_parameters' in results data_regression.check(results['output_parameters'].get_dict())