Skip to content

Commit

Permalink
Merge pull request #4385 from aiidateam/release/1.4.0
Browse files Browse the repository at this point in the history
Release `v1.4.0`
  • Loading branch information
sphuber authored Sep 24, 2020
2 parents 31e981b + ea5b7f5 commit 59ebaf4
Show file tree
Hide file tree
Showing 357 changed files with 11,273 additions and 8,287 deletions.
1 change: 1 addition & 0 deletions .ci/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ pipeline {
}
stage('Build') {
steps {
sh 'pip install --upgrade --user pip'
sh 'pip install --user .[all]'
// To be able to do ssh localhost
sh 'ssh-keygen -t rsa -N "" -f ~/.ssh/id_rsa'
Expand Down
4 changes: 2 additions & 2 deletions .ci/test_plugin_testcase.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def get_computer(cls, temp_dir):
from aiida import orm

computer = orm.Computer(
name='localhost',
label='localhost',
hostname='localhost',
description='my computer',
transport_type='local',
Expand All @@ -80,7 +80,7 @@ def test_computer_loaded(self):
work after resetting the DB.
"""
from aiida import orm
self.assertEqual(orm.Computer.objects.get(name='localhost').uuid, self.computer.uuid)
self.assertEqual(orm.Computer.objects.get(label='localhost').uuid, self.computer.uuid)

def test_tear_down(self):
"""
Expand Down
45 changes: 25 additions & 20 deletions .ci/workchains.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
# For further information please visit http://www.aiida.net #
###########################################################################
# pylint: disable=invalid-name
"""Work chain implementations for testing purposes."""
from aiida.common import AttributeDict
from aiida.engine import calcfunction, workfunction, WorkChain, ToContext, append_, while_, ExitCode
from aiida.engine import BaseRestartWorkChain, process_handler, ProcessHandlerReport
from aiida.engine.persistence import ObjectLoader
from aiida.orm import Int, List, Str
from aiida.plugins import CalculationFactory


ArithmeticAddCalculation = CalculationFactory('arithmetic.add')


Expand Down Expand Up @@ -54,15 +54,15 @@ def setup(self):
def sanity_check_not_too_big(self, node):
"""My puny brain cannot deal with numbers that I cannot count on my hand."""
if node.is_finished_ok and node.outputs.sum > 10:
return ProcessHandlerReport(True, self.exit_codes.ERROR_TOO_BIG)
return ProcessHandlerReport(True, self.exit_codes.ERROR_TOO_BIG) # pylint: disable=no-member

@process_handler(priority=460, enabled=False)
def disabled_handler(self, node):
def disabled_handler(self, node): # pylint: disable=unused-argument
"""By default this is not enabled and so should never be called, irrespective of exit codes of sub process."""
return ProcessHandlerReport(True, self.exit_codes.ERROR_ENABLED_DOOM)
return ProcessHandlerReport(True, self.exit_codes.ERROR_ENABLED_DOOM) # pylint: disable=no-member

@process_handler(priority=450, exit_codes=ExitCode(1000, 'Unicorn encountered'))
def a_magic_unicorn_appeared(self, node):
def a_magic_unicorn_appeared(self, node): # pylint: disable=no-self-argument,no-self-use
"""As we all know unicorns do not exist so we should never have to deal with it."""
raise RuntimeError('this handler should never even have been called')

Expand All @@ -78,30 +78,24 @@ class NestedWorkChain(WorkChain):
"""
Nested workchain which creates a workflow where the nesting level is equal to its input.
"""

@classmethod
def define(cls, spec):
super().define(spec)
spec.input('inp', valid_type=Int)
spec.outline(
cls.do_submit,
cls.finalize
)
spec.outline(cls.do_submit, cls.finalize)
spec.output('output', valid_type=Int, required=True)

def do_submit(self):
if self.should_submit():
self.report('Submitting nested workchain.')
return ToContext(
workchain=append_(self.submit(
NestedWorkChain,
inp=self.inputs.inp - 1
))
)
return ToContext(workchain=append_(self.submit(NestedWorkChain, inp=self.inputs.inp - 1)))

def should_submit(self):
return int(self.inputs.inp) > 0

def finalize(self):
"""Attach the outputs."""
if self.should_submit():
self.report('Getting sub-workchain output.')
sub_workchain = self.ctx.workchain[0]
Expand All @@ -112,15 +106,13 @@ def finalize(self):


class SerializeWorkChain(WorkChain):
"""Work chain that serializes inputs."""

@classmethod
def define(cls, spec):
super().define(spec)

spec.input(
'test',
valid_type=Str,
serializer=lambda x: Str(ObjectLoader().identify_object(x))
)
spec.input('test', valid_type=Str, serializer=lambda x: Str(ObjectLoader().identify_object(x)))

spec.outline(cls.echo)
spec.outputs.dynamic = True
Expand All @@ -130,6 +122,8 @@ def echo(self):


class NestedInputNamespace(WorkChain):
"""Work chain with nested namespace."""

@classmethod
def define(cls, spec):
super().define(spec)
Expand All @@ -143,6 +137,8 @@ def do_echo(self):


class ListEcho(WorkChain):
"""Work chain that simply echos a `List` input."""

@classmethod
def define(cls, spec):
super().define(spec)
Expand All @@ -157,6 +153,8 @@ def do_echo(self):


class DynamicNonDbInput(WorkChain):
"""Work chain with dynamic non_db inputs."""

@classmethod
def define(cls, spec):
super().define(spec)
Expand All @@ -172,6 +170,8 @@ def do_test(self):


class DynamicDbInput(WorkChain):
"""Work chain with dynamic input namespace."""

@classmethod
def define(cls, spec):
super().define(spec)
Expand All @@ -186,6 +186,8 @@ def do_test(self):


class DynamicMixedInput(WorkChain):
"""Work chain with dynamic mixed input."""

@classmethod
def define(cls, spec):
super().define(spec)
Expand All @@ -194,6 +196,7 @@ def define(cls, spec):
spec.outline(cls.do_test)

def do_test(self):
"""Run the test."""
input_non_db = self.inputs.namespace.inputs['input_non_db']
input_db = self.inputs.namespace.inputs['input_db']
assert isinstance(input_non_db, int)
Expand All @@ -206,6 +209,7 @@ class CalcFunctionRunnerWorkChain(WorkChain):
"""
WorkChain which calls an InlineCalculation in its step.
"""

@classmethod
def define(cls, spec):
super().define(spec)
Expand All @@ -223,6 +227,7 @@ class WorkFunctionRunnerWorkChain(WorkChain):
"""
WorkChain which calls a workfunction in its step
"""

@classmethod
def define(cls, spec):
super().define(spec)
Expand Down
4 changes: 1 addition & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ jobs:
keys:
- cache-pip

- run: |
pip install numpy==1.17.4
pip install --user .[docs,tests]
- run: pip install --user .[docs,tests]

- save_cache:
key: cache-pip
Expand Down
1 change: 1 addition & 0 deletions .github/config/localhost-config.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
---
use_login_shell: true
safe_interval: 0
6 changes: 6 additions & 0 deletions .github/config/profile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,10 @@ db_port: 5432
db_name: PLACEHOLDER_DATABASE_NAME
db_username: postgres
db_password: ''
broker_protocol: amqp
broker_username: guest
broker_password: guest
broker_host: 127.0.0.1
broker_port: 5672
broker_virtual_host: ''
repository: PLACEHOLDER_REPOSITORY
39 changes: 39 additions & 0 deletions .github/workflows/benchmark-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"suites": {
"pytest-benchmarks:ubuntu-18.04,django": {
"header": "Performance Benchmarks (Ubuntu-18.04, Django)",
"description": "Performance benchmark tests, generated using pytest-benchmark."
},
"pytest-benchmarks:ubuntu-18.04,sqlalchemy": {
"header": "Performance Benchmarks (Ubuntu-18.04, SQLAlchemy)",
"description": "Performance benchmark tests, generated using pytest-benchmark."
}
},
"groups": {
"node": {
"header": "Single Node",
"description": "Comparison of basic node interactions, such as storage and deletion from the database.",
"single_chart": true,
"xAxis": "id",
"backgroundFill": false,
"yAxisFormat": "logarithmic"
},
"engine": {
"header": "Processes",
"description": "Comparison of Processes, executed via both local and daemon runners.",
"single_chart": true,
"xAxis": "id",
"backgroundFill": false,
"legendAlign": "start",
"yAxisFormat": "logarithmic"
},
"import-export": {
"header": "Import-Export",
"description": "Comparison of import/export of provenance trees.",
"single_chart": true,
"xAxis": "id",
"backgroundFill": false,
"yAxisFormat": "logarithmic"
}
}
}
Loading

0 comments on commit 59ebaf4

Please sign in to comment.