Skip to content

Commit

Permalink
Dependencies: Update requirement for aiida-core~=2.0 (#804)
Browse files Browse the repository at this point in the history
The minimum requirement for `aiida-core` is upped to `v2.0` which was
just released. This commit just does the minimum to get the tests
passing. There are a lot of deprecated warnings that will be addressed
later.

Notable necessary changes:

 * Remove the use of `reentry`. This is no longer necessary in
   `aiida-core==2.0` which uses `importlib_metadata` instead.
 * Remove `click_completion` and add `click~=8.0` as requirement which
   now comes with its own auto-completion built-in.
 * The `aiida.cmdline.params.options.VERBOSITY` option was added to the
   root CLI command. This is necessary for the messages printed through
   the `aiida.cmdline.utils.echo` to actually show up. It is this option
   that automatically configures the logging which is used by that
   module and without it, the messages would not end up to stdout.
 * Update requirements for `docs` extra to build documentation.
 * Remove use of `Node._repository` which has been removed
 * Add `core.` prefix to entry point names in reference test files
 * `Node.add_incoming` -> `Node.base.links.add_incoming`
 * Use `QueryBuilder.first(flat=True` when only single projection
  • Loading branch information
sphuber authored Apr 29, 2022
1 parent 456373c commit 556d9b4
Show file tree
Hide file tree
Showing 15 changed files with 143 additions and 130 deletions.
9 changes: 2 additions & 7 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ jobs:
python-version: '3.8'

- name: Install Python dependencies
run: |
pip install --upgrade pip setuptools wheel
pip install -e .[pre-commit,tests]
run: pip install -e .[pre-commit,tests]

- name: Run pre-commit
run: pre-commit run --all-files || ( git status --short ; git diff ; exit 1 )
Expand Down Expand Up @@ -87,10 +85,7 @@ jobs:
python-version: ${{ matrix.python-version }}

- name: Install Python dependencies
run: |
pip install --upgrade pip setuptools wheel
pip install -e .[tests]
reentry scan
run: pip install -e .[tests]

- name: Run pytest
run: pytest -sv tests
Expand Down
9 changes: 2 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ jobs:
python-version: '3.8'

- name: Install Python dependencies
run: |
pip install --upgrade pip setuptools wheel
pip install -e .[pre-commit,tests]
run: pip install -e .[pre-commit,tests]

- name: Run pre-commit
run: pre-commit run --all-files || ( git status --short ; git diff ; exit 1 )
Expand Down Expand Up @@ -65,10 +63,7 @@ jobs:
python-version: ${{ matrix.python-version }}

- name: Install Python dependencies
run: |
pip install --upgrade pip setuptools wheel
pip install -e .[tests]
reentry scan
run: pip install -e .[tests]

- name: Run pytest
run: pytest -sv tests
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ The matrix below assumes the user always install the latest patch release of the

| Plugin | AiiDA | Python | Quantum ESPRESSO |
|-|-|-|-|
| `v3.5 < v4.0` | ![Compatibility for v3.5][AiiDA v3.4] | [![PyPI pyversions](https://img.shields.io/pypi/pyversions/aiida-quantumespresso.svg)](https://pypi.org/project/aiida-quantumespresso.svg) | ![Quantum ESPRESSO compatibility][QE v6-7] |
| `v4.0 < v5.0` | ![Compatibility for v4.0][AiiDA v4.0] | [![PyPI pyversions](https://img.shields.io/pypi/pyversions/aiida-quantumespresso.svg)](https://pypi.org/project/aiida-quantumespresso.svg) | ![Quantum ESPRESSO compatibility][QE v6-7] |
| `v3.5 < v4.0` | ![Compatibility for v3.5][AiiDA v3.5] | [![PyPI pyversions](https://img.shields.io/pypi/pyversions/aiida-quantumespresso.svg)](https://pypi.org/project/aiida-quantumespresso.svg) | ![Quantum ESPRESSO compatibility][QE v6-7] |
| `v3.4 < v3.5` | ![Compatibility for v3.4][AiiDA v3.4] | [![PyPI pyversions](https://img.shields.io/pypi/pyversions/aiida-quantumespresso.svg)](https://pypi.org/project/aiida-quantumespresso.svg) | ![Quantum ESPRESSO compatibility][QE v6] |
| `v3.3 < v3.4` | ![Compatibility for v3.3][AiiDA v3.3] | [![PyPI pyversions](https://img.shields.io/pypi/pyversions/aiida-quantumespresso.svg)](https://pypi.org/project/aiida-quantumespresso.svg) | ![Quantum ESPRESSO compatibility][QE v6] |
| `v3.1 < v3.3` | ![Compatibility for v3.1][AiiDA v3.1] | | ![Quantum ESPRESSO compatibility][QE v6] |
Expand Down Expand Up @@ -102,7 +103,7 @@ We acknowledge support from:

<img src="https://raw.githubusercontent.com/aiidateam/aiida-quantumespresso/develop/docs/source/images/swissuniversities.png" width="300px" height="35px"/>


[AiiDA v4.0]: https://img.shields.io/badge/AiiDA>=2.0.0,<3.0.0-007ec6.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACMAAAAhCAYAAABTERJSAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAFhgAABYYBG6Yz4AAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAUbSURBVFiFzZhrbFRVEMd%2Fc%2B5uu6UUbIFC%2FUAUVEQCLbQJBIiBDyiImJiIhmohYNCkqJAQxASLF8tDgYRHBLXRhIcKNtFEhVDgAxBJqgmVh4JEKg3EIn2QYqBlt917xg%2BFss%2ByaDHOtzsz5z%2B%2FuZl7ztmF%2F5HJvxVQN6cPYX8%2FPLnOmsvNAvqfwuib%2FbNIk9cQeQnLcKRL5xLIV%2Fic9eJeunjPYbRs4FjQSpTB3aS1IpRKeeOOewajy%2FKKEO8Q0DuVdKy8IqsbPulxGHUfCBBu%2BwUYGuFuBTK7wQnht6PEbf4tlRomVRjCbXNjQEB0AyrFQOL5ENIJm7dTLZE6DPJCnEtFZVXDLny%2B4Sjv0PmmYu1ZdUek9RiMgoDmJ8V0L7XJqsZ3UW8YsBOwEeHeeFce7jEYXBy0m9m4BbXqSj2%2Bxnkg26MCVrN6DEZcwggtd8pTFx%2Fh3B9B50YLaFOPwXQKUt0tBLegtSomfBlfY13PwijbEnhztGzgJsK5h9W9qeWwBqjvyhB2iBs1Qz0AU974DciRGO8CVN8AJhAeMAdA3KbrKEtvxhsI%2B9emWiJlGBEU680Cfk%2BSsVqXZvcFYGXjF8ABVJ%2BTNfVXehyms1zzn1gmIOxLEB6E31%2FWBe5rnCarmo7elf7dJEeaLh80GasliI5F6Q9cAz1GY1OJVNDxTzQTw7iY%2F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tl2s7owDUdocR5bceiyoSivGTT5vzpbzL1uoBpmcAAQgW7ArnKD9ng9rc%2BNgrobSNwpSkkhcRN%2BvmXLjIsDovYHHEfmsYFygPAnIDEQrQPzJYCOaLHLUfIt7Oq0LJn9fxkSgNCb1qEIQ5UKgT%2Fs6gJmVOOroJhQBXVqw118QtWLdyUxEP45sUpSzqP7RDdFYMyB9UReMiF1MzPwoUqHt8hjGFFeP5wZAbZ%2F0%2BcAtAAcji6LeSq%2FMYiAvSsdw3GtrfVSVFUBbIhwRWYR7yOcr%2FBi%2FB1MSJZ16JlgH1AGM3EO2QnmMyrSbTSiACgFBv4yCUapZkt9qwWVL7aeOyHvArJjm8%2Fz9BhdI4XcZgz2%2FvRALosjsk1ODOyMcJn9%2FYI6IrkS5vxMGdUwou2YKfyVqJpn5t9aNs3gbQMbdbkxnGdsr4bTHm2AxWo9yNZK4PXR3uzhAh%2BM0AZejnCrGdy0UvJxl0oMKgWSLR%2B1LH2aE9ViejiFs%2BXn6bTjng3MlIhJ1I1TkuLdg6OcAbD7Xx%2Bc3y9TrWAiSHqVkbZ2v9ilCo6s4AjwZCzFyD9mOL305nV9aonvsQeT2L0gVk4OwOJqXXVRW7naaxswDKVdlYLyMXAnntteYmws2xcVVZzq%2BtHPAooQggmJkc6TLSusOiL4RKgwzzYU1iFQgiUBA1H7E8yPau%2BZl9P7AblVNebtHqTgxLfRqrNvZWjsHZFuqMqKcDWdlFjF7UGvX8Jn24DyEAykJwNcdg0OvJ4p5pQ9tV6SMlP4A0PNh8aYze1ArROyUNTNouy8tNF3Rt0CSXb6bRFl4%2FIfQzNMjaE9WwpYOWQnOdEF%2BTdJNO0iFh7%2BI0kfORzQZb6P2kymS9oTxzBiM9rUqLWr1WE5G6ODhycQd%2FUnNVeMbcH68hYkGycNoUNWc8fxaxfwhDbHpfwM5oeTY7rUX8QAAAABJRU5ErkJggg%3D%3D
Expand Down
44 changes: 38 additions & 6 deletions aiida_quantumespresso/cli/__init__.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,49 @@
# -*- coding: utf-8 -*-
# pylint: disable=wrong-import-position,wildcard-import
# pylint: disable=wrong-import-position
"""Module for the command line interface."""
from aiida.cmdline.params import options, types
import click
import click_completion

# Activate the completion of parameter types provided by the click_completion package
click_completion.init()

class VerbosityGroup(click.Group):
"""Custom command group that automatically adds the ``VERBOSITY`` option to all subcommands."""

@staticmethod
def add_verbosity_option(cmd):
"""Apply the ``verbosity`` option to the command, which is common to all ``verdi`` commands."""
if 'verbosity' not in [param.name for param in cmd.params]:
cmd = options.VERBOSITY()(cmd)

return cmd

def group(self, *args, **kwargs):
"""Ensure that sub command groups use the same class but do not override an explicitly set value."""
kwargs.setdefault('cls', self.__class__)
return super().group(*args, **kwargs)

def get_command(self, ctx, cmd_name):
"""Return the command that corresponds to the requested ``cmd_name``.
This method is overridden from the base class in order to automatically add the verbosity option.
Note that if the command is not found and ``resilient_parsing`` is set to True on the context, then the latter
feature is disabled because most likely we are operating in tab-completion mode.
"""
cmd = super().get_command(ctx, cmd_name)

if cmd is not None:
return self.add_verbosity_option(cmd)

if ctx.resilient_parsing:
return None

return ctx.fail(f'`{cmd_name}` is not a {self.name} command.')


@click.group('aiida-quantumespresso', context_settings={'help_option_names': ['-h', '--help']})
@options.PROFILE(type=types.ProfileParamType(load_profile=True))
def cmd_root(profile): # pylint: disable=unused-argument
@options.PROFILE(type=types.ProfileParamType(load_profile=True), expose_value=False)
@options.VERBOSITY()
def cmd_root():
"""CLI for the `aiida-quantumespresso` plugin."""


Expand Down
6 changes: 2 additions & 4 deletions aiida_quantumespresso/cli/utils/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ def get_structure():
}

builder = QueryBuilder().append(StructureData, filters=filters)
results = builder.first()
structure = builder.first(flat=True)

if not results:
if not structure:
alat = 5.43
ase_structure = crystal(
'Si',
Expand All @@ -40,7 +40,5 @@ def get_structure():
)
structure = StructureData(ase=ase_structure)
structure.store()
else:
structure = results[0]

return structure.uuid
2 changes: 1 addition & 1 deletion aiida_quantumespresso/parsers/cp.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def parse(self, **kwargs):
retrieved = self.retrieved

# check what is inside the folder
list_of_files = retrieved._repository.list_object_names()
list_of_files = retrieved.list_object_names()

# options.metadata become attributes like this:
stdout_filename = self.node.get_attribute('output_filename')
Expand Down
11 changes: 3 additions & 8 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,15 @@
# serve to show the default.
import time

# ensure plugins are loaded
from reentry import manager
# Load the dummy profile even if we are running locally, this way the documentation will succeed even if the current
# default profile of the AiiDA installation does not use a Django backend.
from aiida.manage.configuration import load_documentation_profile

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
import aiida_quantumespresso

manager.scan()

# Load the dummy profile even if we are running locally, this way the documentation will succeed even if the current
# default profile of the AiiDA installation does not use a Django backend.
from aiida.manage.configuration import load_documentation_profile

load_documentation_profile()

# -- Project information -----------------------------------------------------
Expand Down
23 changes: 10 additions & 13 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ classifiers = [
keywords = ['aiida', 'workflows']
requires-python = '>=3.8'
dependencies = [
'psycopg2-binary<2.9',
'aiida_core[atomic_tools]~=1.4,>=1.4.4',
'aiida-pseudo~=0.6.1',
'aiida_core[atomic_tools]~=2.0',
'aiida-pseudo~=0.7.0',
'click~=8.0',
'importlib_resources',
'jsonschema',
'numpy',
'packaging',
'qe-tools~=2.0rc1',
'xmlschema~=1.2,>=1.2.5',
'numpy',
'importlib_resources'
'xmlschema~=1.2,>=1.2.5'
]

[project.urls]
Expand All @@ -39,12 +39,10 @@ Documentation = 'https://aiida-quantumespresso.readthedocs.io'

[project.optional-dependencies]
docs = [
'Sphinx',
'docutils',
'markupsafe<2.1',
'sphinx-copybutton~=0.3.0',
'sphinx-book-theme~=0.1.0',
'sphinx-click~=2.7.1'
'sphinx~=4.1',
'sphinx-copybutton~=0.5.0',
'sphinx-book-theme~=0.3.2',
'sphinx-click~=4.0',
]
pre-commit = [
'pre-commit~=2.17',
Expand Down Expand Up @@ -190,7 +188,6 @@ testpaths = [
filterwarnings = [
'ignore::DeprecationWarning:frozendict:',
'ignore::DeprecationWarning:pkg_resources:',
'ignore::DeprecationWarning:reentry:',
'ignore::DeprecationWarning:sqlalchemy_utils:',
]

Expand Down
2 changes: 1 addition & 1 deletion tests/calculations/test_epw.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def test_epw_default(
}

parameters2 = orm.Dict(dict=qibz)
parameters2.add_incoming(parent_ph.creator, link_label='output_parameters', link_type=LinkType.CREATE)
parameters2.base.links.add_incoming(parent_ph.creator, link_label='output_parameters', link_type=LinkType.CREATE)
parameters2.store()

inputs = {
Expand Down
10 changes: 5 additions & 5 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ def _generate_calc_job_node(

for link_label, input_node in flatten_inputs(inputs):
input_node.store()
node.add_incoming(input_node, link_type=LinkType.INPUT_CALC, link_label=link_label)
node.base.links.add_incoming(input_node, link_type=LinkType.INPUT_CALC, link_label=link_label)

node.store()

Expand All @@ -282,11 +282,11 @@ def _generate_calc_job_node(
except OSError:
pass # To test the absence of files in the retrieve_temporary folder

retrieved.add_incoming(node, link_type=LinkType.CREATE, link_label='retrieved')
retrieved.base.links.add_incoming(node, link_type=LinkType.CREATE, link_label='retrieved')
retrieved.store()

remote_folder = orm.RemoteData(computer=computer, remote_path='/tmp')
remote_folder.add_incoming(node, link_type=LinkType.CREATE, link_label='remote_folder')
remote_folder.base.links.add_incoming(node, link_type=LinkType.CREATE, link_label='remote_folder')
remote_folder.store()

return node
Expand Down Expand Up @@ -393,7 +393,7 @@ def _generate_remote_data(computer, remote_path, entry_point_name=None):
if entry_point_name is not None:
creator = CalcJobNode(computer=computer, process_type=entry_point)
creator.set_option('resources', {'num_machines': 1, 'num_mpiprocs_per_machine': 1})
remote.add_incoming(creator, link_type=LinkType.CREATE, link_label='remote_folder')
remote.base.links.add_incoming(creator, link_type=LinkType.CREATE, link_label='remote_folder')
creator.store()

return remote
Expand Down Expand Up @@ -650,7 +650,7 @@ def _generate_workchain_pw(exit_code=None, inputs=None, return_inputs=False, pw_

if pw_outputs is not None:
for link_label, output_node in pw_outputs.items():
output_node.add_incoming(pw_node, link_type=LinkType.CREATE, link_label=link_label)
output_node.base.links.add_incoming(pw_node, link_type=LinkType.CREATE, link_label=link_label)
output_node.store()

if exit_code is not None:
Expand Down
Loading

0 comments on commit 556d9b4

Please sign in to comment.