Skip to content

Commit

Permalink
Remove cli and update entry points
Browse files Browse the repository at this point in the history
  • Loading branch information
kmlefran committed Jan 21, 2024
1 parent b7c22b4 commit 5b37a3d
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 88 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ intended to help developers get started with their AiiDA plugins.
* [`aiida_aimall/`](aiida_aimall/): The main source code of the plugin package
* [`data/`](aiida_aimall/data/): A new `AimqbParameters` data class, used as input to the `AimqbCalculation` `CalcJob` class
* [`calculations.py`](aiida_aimall/calculations.py): A new `AimqbCalculation` `CalcJob` class, and `GaussianWFXCalculation`, a modified version of `GaussianCalculation` from [AiiDA Gaussian](https://github.com/nanotech-empa/aiida-gaussian)
* [`cli.py`](aiida_aimall/cli.py): Extensions of the `verdi data` command line interface for the `AimqbParameters` class
* [`parsers.py`](aiida_aimall/parsers.py): A new `Parser` for the `AimqbCalculation`, and `GaussianWFXParser`, a modified version of `GaussianBaseParser` from [AiiDA Gaussian](https://github.com/nanotech-empa/aiida-gaussian)
* [`workchains.py`](aiida_aimall/workchains.py): New `WorkChains`.
* * `MultiFragmentWorkChain` to fragment molecules using cml files from the Retrievium database and submit Gaussian calculations for the fragments using functions in `frag_functions` from [subproptools Github](https:github.com/kmlefran/group_decomposition)
Expand Down
6 changes: 3 additions & 3 deletions aiida_aimall/calculations.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from aiida.plugins import DataFactory
from pymatgen.io.gaussian import GaussianInput # pylint: disable=import-error

AimqbParameters = DataFactory("aimall")
AimqbParameters = DataFactory("aimall.aimqb")


class AimqbCalculation(CalcJob):
Expand All @@ -34,10 +34,10 @@ class AimqbCalculation(CalcJob):
::
code = orm.load_code('aimall@localhost')
AimqbParameters = DataFactory("aimall")
AimqbParameters = DataFactory("aimall.aimqb")
aim_params = AimqbParameters(parameter_dict={"naat": 2, "nproc": 2, "atlaprhocps": True})
file=SinglefileData(io.BytesIO(file_string.encode()))
AimqbCalculation = CalculationFactory("aimall")
AimqbCalculation = CalculationFactory("aimall.aimqb")
builder = AimqbCalculation.get_builder()
builder.parameters = aim_params
builder.file = file
Expand Down
60 changes: 0 additions & 60 deletions aiida_aimall/cli.py

This file was deleted.

14 changes: 7 additions & 7 deletions aiida_aimall/controllers.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
from aiida.plugins import CalculationFactory, DataFactory, WorkflowFactory
from aiida_submission_controller import FromGroupSubmissionController

AimqbParameters = DataFactory("aimall")
GaussianCalculation = CalculationFactory("gaussianwfx")
AimqbCalculation = CalculationFactory("aimall")
AimqbParameters = DataFactory("aimall.aimqb")
GaussianCalculation = CalculationFactory("aimall.gaussianwfx")
AimqbCalculation = CalculationFactory("aimall.aimqb")


class G16FragController(FromGroupSubmissionController):
Expand All @@ -24,7 +24,7 @@ class G16FragController(FromGroupSubmissionController):
max_concurrent: int
g16_opt_params: dict

WORKFLOW_ENTRY_POINT = "g16opt"
WORKFLOW_ENTRY_POINT = "aimall.g16opt"

def __init__(
self,
Expand Down Expand Up @@ -76,7 +76,7 @@ class AimReorSubmissionController(FromGroupSubmissionController):
max_concurrent: int
code_label: str

WORKFLOW_ENTRY_POINT = "aimreor"
WORKFLOW_ENTRY_POINT = "aimall.aimreor"

def __init__(
self,
Expand Down Expand Up @@ -141,7 +141,7 @@ class AimAllSubmissionController(FromGroupSubmissionController):
code_label: str
aim_parser: str

CALCULATION_ENTRY_POINT = "aimall"
CALCULATION_ENTRY_POINT = "aimall.aimqb"

def __init__(
self,
Expand Down Expand Up @@ -216,7 +216,7 @@ class GaussianSubmissionController(FromGroupSubmissionController):
code_label: str
g16_sp_params: dict
# GaussianWFXCalculation entry point as defined in aiida-aimall pyproject.toml
CALCULATION_ENTRY_POINT = "gaussianwfx"
CALCULATION_ENTRY_POINT = "aimall.gaussianwfx"

def __init__(
self,
Expand Down
2 changes: 1 addition & 1 deletion aiida_aimall/parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# from aiida.engine import ExitCode


AimqbCalculation = CalculationFactory("aimall")
AimqbCalculation = CalculationFactory("aimall.aimqb")


class AimqbBaseParser(Parser):
Expand Down
6 changes: 3 additions & 3 deletions docs/source/user_guide/get_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
Getting started
===============

This guide was written for my group, but still including in docs for now - maybe you will find it useful. Near complete AiiDA setup and instructions.

Installation
++++++++++++

Expand Down Expand Up @@ -78,9 +80,7 @@ Step 8: Install aiida-aimall
----------------------------
::

git clone https://github.com/kmlefran/aiida-aimall .
cd aiida-aimall
pip install -e . # also installs aiida, if missing (but not postgres)
pip install aiida-aimall
#verify that entry points are registered
verdi plugin list aiida.calculations # should show aimall and gaussianwfx
verdi plugin list aiida.parsers # should show aimqb.base and gaussianwfx
Expand Down
2 changes: 1 addition & 1 deletion example/aiida-aimall_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"# load controllers\n",
"from aiida_aimall.controllers import AimAllSubmissionController, AimReorSubmissionController, GaussianSubmissionController, G16FragController\n",
"# load the first workchain\n",
"MultiFragmentWorkChain = WorkflowFactory('multifrag')\n",
"MultiFragmentWorkChain = WorkflowFactory('aimall.multifrag')\n",
"\n",
"#Restart the daemons just to make sure they are on\n",
"%verdi daemon stop\n",
Expand Down
24 changes: 12 additions & 12 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -80,25 +80,25 @@ docs = [
]

[project.entry-points."aiida.data"]
"aimall" = "aiida_aimall.data:AimqbParameters"
"aimall.aimqb" = "aiida_aimall.data:AimqbParameters"

[project.entry-points."aiida.calculations"]
"aimall" = "aiida_aimall.calculations:AimqbCalculation"
"gaussianwfx" = "aiida_aimall.calculations:GaussianWFXCalculation"
"aimall.aimqb" = "aiida_aimall.calculations:AimqbCalculation"
"aimall.gaussianwfx" = "aiida_aimall.calculations:GaussianWFXCalculation"

[project.entry-points."aiida.parsers"]
"aimqb.base" = "aiida_aimall.parsers:AimqbBaseParser"
"aimqb.group" = "aiida_aimall.parsers:AimqbGroupParser"
"gaussianwfx" = "aiida_aimall.parsers:GaussianWFXParser"
"aimall.base" = "aiida_aimall.parsers:AimqbBaseParser"
"aimall.group" = "aiida_aimall.parsers:AimqbGroupParser"
"aimall.gaussianwfx" = "aiida_aimall.parsers:GaussianWFXParser"

[project.entry-points."aiida.workflows"]
"multifrag" = "aiida_aimall.workchains:MultiFragmentWorkChain"
"g16opt" = "aiida_aimall.workchains:G16OptWorkchain"
"aimreor" = "aiida_aimall.workchains:AIMAllReor"
"optaimreor" = "aiida_aimall.workchains:OptAimReorSPAimWorkChain"
"aimall.multifrag" = "aiida_aimall.workchains:MultiFragmentWorkChain"
"aimall.g16opt" = "aiida_aimall.workchains:G16OptWorkchain"
"aimall.aimreor" = "aiida_aimall.workchains:AIMAllReor"
"aimall.optaimreor" = "aiida_aimall.workchains:OptAimReorSPAimWorkChain"

[project.entry-points."aiida.cmdline.data"]
"aimall" = "aiida_aimall.cli:data_cli"
#[project.entry-points."aiida.cmdline.data"]
#"aimall" = "aiida_aimall.cli:data_cli"

[tool.flit.module]
name = "aiida_aimall"
Expand Down

0 comments on commit 5b37a3d

Please sign in to comment.