Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preparation for aiida 2.x compatibility #40

Closed
JPchico opened this issue Jun 10, 2022 · 12 comments
Closed

Preparation for aiida 2.x compatibility #40

JPchico opened this issue Jun 10, 2022 · 12 comments

Comments

@JPchico
Copy link
Collaborator

JPchico commented Jun 10, 2022

In the develop branch most of the things should be compatible with aiida-2.x. But it needs to be thoroughly tested and make sure that no outstanding deprecation warnings are left. The idea of this issue is to act as a placeholder to ensure that we can discuss if anything needs to be done for this.

@JPchico
Copy link
Collaborator Author

JPchico commented Aug 5, 2022

@chrisjsewell How is the progress with this? I know that you did some changes regarding this and in my tests it seems to work in 2.x but I'm unsure on whether there is something else that needs to be done.

@chrisjsewell
Copy link
Member

If you turned on the (off the top of my head) AIIDA_V3=1 when running pytest, I imagine you would see a number of deprecation warnings, for method renaming. But obviously these are not critical for compatibility

@JPchico
Copy link
Collaborator Author

JPchico commented Aug 5, 2022

cool cool, will explore this!

@chrisjsewell
Copy link
Member

Actually it was AIIDA_WARN_v3 = 1

@chrisjsewell
Copy link
Member

@JPchico
Copy link
Collaborator Author

JPchico commented Aug 5, 2022

I had found ti in the wiki when talking about migration to version 2 so no worries =) currently checking the deprecation warnings

@JPchico
Copy link
Collaborator Author

JPchico commented Aug 5, 2022

@chrisjsewell I think I have managed to get rid of most of the warnings. The only one that I have not managed to figure out what it trying to tell me is the following. Any idea?

orm/entities.py:175: AiidaDeprecationWarning: This property is deprecated, use `.collection` instead. (this will be removed in v3)
    warn_deprecation('This property is deprecated, use `.collection` instead.', version=3, stacklevel=2)

@JPchico
Copy link
Collaborator Author

JPchico commented Aug 5, 2022

Never mind I think I figured it out it seems to be that in the test utilities it was calling for Computer.objects.get(label=name) and it should have been Computer.collection.get(label=name)

JPchico pushed a commit to JPchico/aiida-lammps that referenced this issue Aug 5, 2022
@JPchico
Copy link
Collaborator Author

JPchico commented Aug 5, 2022

@chrisjsewell I have managed to get rid of all the deprecation warnings. However, there is an issue with the test for the md_multi

It seems to be trying to add a file to the retrieved?

        for stage, (step, rpath) in restart_map.items():
            with open(rpath, "rb") as handle:
                self.retrieved.base.repository.put_object_from_filelike(
                    handle, os.path.basename(rpath)
                )

Which is causing an Exception to be raised

 REPORT   aiida.orm.nodes.process.calculation.calcjob.CalcJobNode:process.py:564 [185|MdMultiCalculation|on_except]: Traceback (most recent call last):
  File "/usr/share/miniconda/envs/__setup_conda/lib/python3.8/site-packages/plumpy/process_states.py", line 228, in execute
    result = self.run_fn(*self.args, **self.kwargs)
  File "/usr/share/miniconda/envs/__setup_conda/lib/python3.8/site-packages/aiida/engine/processes/calcjobs/calcjob.py", line 473, in parse
    exit_code_retrieved = self.parse_retrieved_output(retrieved_temporary_folder)
  File "/usr/share/miniconda/envs/__setup_conda/lib/python3.8/site-packages/aiida/engine/processes/calcjobs/calcjob.py", line 564, in parse_retrieved_output
    exit_code = parser.parse(**parse_kwargs)
  File "/home/runner/work/aiida-lammps/aiida-lammps/aiida_lammps/parsers/lammps/md_multi.py", line 112, in parse
    self.retrieved.base.repository.put_object_from_filelike(
  File "/usr/share/miniconda/envs/__setup_conda/lib/python3.8/site-packages/aiida/orm/nodes/repository.py", line 234, in put_object_from_filelike
    self._check_mutability()
  File "/usr/share/miniconda/envs/__setup_conda/lib/python3.8/site-packages/aiida/orm/nodes/repository.py", line 68, in _check_mutability
    raise exceptions.ModificationNotAllowed('the node is stored and therefore the repository is immutable.')
aiida.common.exceptions.ModificationNotAllowed: the node is stored and therefore the repository is immutable.

Which seems to just be indicating that you cannot modify a node after it has been stored (which makes sense). However, I have no idea how this was working before if this was the case. As Nodes have always been immutable, there seems that there was a Force=True parameter which does not exist now, I wonder if that is the difference.

Any idea on how to solve this? Or should we just skip this? After all this calculation is going to be deprecated and replaced with the new calculation methods.

You can check my changes in my fork

@JPchico
Copy link
Collaborator Author

JPchico commented Aug 10, 2022

@chrisjsewell if you agree I will remove the tests for the md_multi (since this will be deprecated in the next release) and if everything passes then I think this should be ready to merge. Do you agree?

@JPchico
Copy link
Collaborator Author

JPchico commented Aug 19, 2022

Closed via #48 . If any other issues are detected they will be solved in individual issues.

@JPchico JPchico closed this as completed Aug 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants