https://github.com/aiidateam/aiida_core

sort by:
Revision Author Date Message Commit Date
dd6e7a6 Docs: Minor documentation fixes (#4643) Small changes and fixes in the documentation. 11 January 2021, 14:35:26 UTC
9419068 🧪 FIX: engine benchmark tests (#4652) The `test_workchain_daemon` test group required updating to using asyncio (rather than tornado) 10 January 2021, 17:31:00 UTC
7b03f04 Add `verdi group delete --delete-nodes` (#4578) This commit makes a number of improvements to the deletion of nodes API/CLI: 1. Makes `delete_nodes` usable outside of `click`; adding a callback for the confirmation step, rather than calling `click.confirm` directly, and using logging instead of `click.echo` 2. Moves the function from `aiida/manage/database/delete/nodes.py` to `aiida/tools/graph/deletions.py`, leaving a deprecation warning at the old location. This is a more intuitive place since the function is directly build on the graph traversal functionality. 3. Exposes API functions *via* `from aiida.tools import delete_nodes` and adds their use to the documentation. 4. Adds `delete_group_nodes` mainly as a wrapper around `delete_nodes`; querying for all the node pks in the groups, then passing these to `delete_nodes` 5. Adds the ability to delete nodes to `verdi group delete --delete-nodes`, with the same flags and logic as `verdi node delete` 6. Fixes a bug in `verdi node delete`, introduced by #4575, if a node does not exist 07 January 2021, 21:34:07 UTC
32c3228 CLI: ensure `verdi database version` works even if schema outdated (#4641) The command was failing if the database schema was out of sync because the backend was loaded, through `get_manager`, with the default schema check on. Since the database does not actually have to be used, other than to retrieve the current schema version and generation, we can load the backend without the check. 20 December 2020, 09:31:52 UTC
6c60afb Dependencies: update requirement `plumpy~=0.18.1` (#4642) This patch release of `plumpy` fixes a critical bug that makes the new `asyncio` based implementation of the engine compatible with Jupyter notebooks. 18 December 2020, 14:34:13 UTC
724fc6c CI: skip `restapi.test_threaded_restapi:test_run_without_close_session` This test has been consistently failing on Python 3.8 and 3.9 despite the two reruns using flaky. For now we skip it entirely instead. 17 December 2020, 17:19:24 UTC
acc870d CI: remote the `numpy` install workaround for `pymatgen` The problem occurred due to an outdated version of `setuptools` which would be invoked when `pymatgen` gets installed from a tarball, in which case the wheel has to be built. In this scenario, the build requirements get installed by `setuptools`, which at outdated versions did not respect the Python requirements of the dependencies which would cause incompatible version of `numpy` to be installed, calling the build to fail. By updating `setuptools` the workaround of manually installing a compatible `numpy` version beforehand is no longer necessary. 17 December 2020, 17:19:24 UTC
e04e786 `CalcJob`: improve testing and documentation of `retrieve_list` (#4611) The documentation on the `retrieve_list` syntax and its functioning was incorrect. The inaccuracies are corrected and extensive examples are provided that give an example file hierarchy for the remote working directory and then for a variety of definitions of the `retrieve_list` the resulting file structure in the retrieved folder is depicted. 15 December 2020, 17:52:32 UTC
6f11c8a Engine: remote `with_persistence=False` from process function runner (#4633) In principle the runner for a process function does not need a persister since it runs in one go and does not have intermediate steps at which the progress needs to be persisted. However, since the process function implementation calls `Manager.get_runner`, if a runner has not yet been created in the interpreter, one will be created and set to be the global one. This is where the problem occurs because the process function specifies `with_persistence=False` for the runner. This will cause any subsequent process submissions to fail since the `submit` function will call `runner.persister.save_checkpoint` which will fail since the `persister` of the runner is `None`. 15 December 2020, 07:40:38 UTC
073639a Docs: add content from old documentation on caching/hashing (#4546) Move the content of "Controlling hashing" and "Design guidelines" inside of `developer_guide/core/caching.rst` to `topics/provenance/caching`. 11 December 2020, 12:10:02 UTC
7d0d5a9 Dependencies: update requirement `kiwipy~=0.7.1` and `plumpy~=0.18.0` (#4629) A breaking change was released with `kiwipy==0.5.4` where the default value for the task message TTL was changed. This caused connections to existing RabbitMQ queues to fail. Since process task queues are permanent in AiiDA, this would break all existing installations. This problem was fixed by reverting the change which was released with `kiwipy==0.5.5`, however, this was a support patch at the time and the revert never made it into the main line, leaving all versions up from `v0.6.0` still affected. Since these versions of `kiwipy` were never required by a released version of `aiida-core`, but only the current `develop`, which will become `v1.6.0`, we can simply update the requirement to the latest patch `kiwipy==0.7.1` that addressed the problem. The dependency requirement for `plumpy` also had to be updated because the old pinned minor version was pinned to `kiwipy~=0.6.0` which is not compatible with our new requirements. 10 December 2020, 09:33:37 UTC
8260b59 Add the `TransferCalcJob` plugin (#4194) This calcjob allows the user to copy files between a remote machine and the local machine running AiiDA. More specifically, it can do any of the following: * Take any number of files from any number of `RemoteData` folders in a remote machine and copy them in the local repository of a single newly created `FolderData` node. * Take any number of files from any number of `FolderData` nodes in the local machine and copy them in a single newly created `RemoteData` folder in a given remote machine. These are the main two use cases, but there are also other more complex combinations allowed by the current implementation. Co-authored-by: Sebastiaan Huber <mail@sphuber.net> 09 December 2020, 21:39:12 UTC
a873332 Merge pull request #4628 from aiidateam/master Merge `master` after release of `v1.5.2` 09 December 2020, 11:09:08 UTC
7b8a400 Merge pull request #4620 from ramirezfranciscof/release/v1.5.2 Release `v1.5.2` 07 December 2020, 18:23:28 UTC
ce8886c Release `v1.5.2` 07 December 2020, 17:23:18 UTC
e073972 CLI: add the `verdi database version` command (#4613) This shows the schema generation and version of the database of the given profile, useful mostly for developers when debugging. In addition to the new command, the code in `aiida.manage.manager` had to be updated for the new functionality to work. The `get_backend_manager` was so far _not_ loading the backend, although that really doesn't make any sense. It is providing access to data from the database, but to do so the backend should be loaded, otherwise a connection isn't possible. This problem went unnoticed, because the `BackendManager` was so far only used in `aiida.engine.utils.set_process_state_change_timestamp`. By the time this gets used, the database backend will already have been loaded through another code path. For the change `verdi database version` command, however, the call to get the backend manager needed to make sure that the database backend itself was also loaded. It was not possible to have `get_backend_manager` simply call `_load_backend()` because this would lead to infinite recursion as `_load_backend()` also calls `get_backend_manager`. Therefore `_load_backend` is refactored to not call the former but rather to directly fetch it through `aiida.backends`. 07 December 2020, 15:30:15 UTC
50167b2 Merge remote-tracking branch 'origin/master' into develop 04 December 2020, 21:46:44 UTC
9a6c5ab Merge pull request #4619 from aiidateam/release/1.5.1 Release `v1.5.1` 04 December 2020, 21:45:44 UTC
e98f9ea Release `v1.5.1` 04 December 2020, 18:21:17 UTC
65e30fb `Dict`: ensure `KeyError` is raise when using `getitem` (#4577) When accessing an attribute as a dict (`dictnode['key']`), the error raised was an `AttributeError` instead of a `KeyError` which is inconsistent. This has been fixed and a test that checks the correct error raise has been added. Cherry-pick: 87d7a60fa3ba9077aefac954dca696385196923f 04 December 2020, 13:38:15 UTC
8058a97 CI: manually install to prevent incompatible releases When `pymatgen` gets installed through `pip` it needs to be built and its build process will not respect any package version requirements that `aiida-core` imposes. A common problem is that the latest `numpy` release will get installed, including pre-releases, which often break our tests because it drops support of certain Python versions. To workaround this, the workflows are updated to install an explicit version of `numpy` that we know is compatible before installing `aiida-core` itself. In this case, `pymatgen` should simply use that version and not install the latest. Cherry-pick: c063609f48c494418164c3e043568628bf66c3a8 04 December 2020, 12:52:49 UTC
e57d18d Daemon: replace deprecated classmethods of `asyncio.Task` in shutdown (#4608) The `shutdown` function, that was attached to the loop of the daemon runner in `aiida.engine.daemon.runner.start_daemon`, was calling the classmethods `current_task` and `all_tasks` of `asyncio.Task` which have been deprecated in Python 3.7 and are removed in Python 3.9. This would prevent the daemon runners from being shutdown in Python 3.9. The methods have been replaced with top level functions that can be imported directl from `asyncio`. This was not noticed in the tests because in the tests the daemon is stopped but it is not checked whether this happens successfully. Anyway, the error would only show up in the daemon log. To test the shutdown method, it has been made into a standalone coroutine and renamed to `shutdown_runner`. Since the `shutdown_runner` is a coroutine, the unit test that calls it also has to be one and therefore we need `pytest-asyncio` as a dependency. The `event_loop` fixture, that is provided by this library, is overrided such that it provides the event loop of the `Manager`, since in AiiDA only ever this single reentrant loop should be used. Note that the current CI tests run against Python 3.6 and Python 3.9 and so will still not catch this problem, however, the `test-install` workflow _does_ run against Python 3.9. I have opted not to change the continuous integrations to run against Python 3.9 instead of 3.8, since they take more than twice the time. Supposedly this is because certain dependencies have to be built and compiled from scratch when the testing environment is started. 03 December 2020, 10:28:34 UTC
b9fcbd8 Config: make writing to disk as atomic as possible (#4607) The original implementation of the `Config.store` method, that writes the configuration from memory to disk, was using `shutil.copy` which is not an atomic operation. It is therefore possible that if the copy operation is interrupted the configuration is not written entirely and is left either empty or in a corrupted state. Making this an atomic operation in 100% of the cases is not trivial and even on the application level there are no guarantees as even on the file system level operations that should be atomic can be interrupted under very rare circumstances. However, we can make a significant improvement by replacing the use of `shutil.copy` with `os.rename`, which because it is a file move operation should be atomic and therefore less prone to being interrupted. The new algorithm for storing the config is as follows: 1. Create temporary file in same directory as target file 2. Write content of in memory config to the temporary file and flush 3. Use `os.rename` to move the temporary file to target destination This should prevent most common cases that could corrupt the existing configuration file. Finally, in `Config.from_method` now only `FileNotFoundError` is caught when trying to read the config file from disk. Originally both `IOError` and `OSError` were being caught, which can also be raised if an existing file could not be read. Simply overwriting in this case with a default config is not desirable and so in this case we simply let the exception bubble up. 02 December 2020, 12:08:03 UTC
d604916 SqlAlchemy: fix bug in `Group` extras migration with revision `0edcdd5a30f0` This migration added the JSONB column `extras` to the `DbGroup` model. Since this needs to be a non-nullable column, but existing group rows would have a null value, the migration was implemented by first adding the column as nullable, after which all rows had their value set to the default, before making the column non-nullable. This approach was working when the revision was run by itself in an isolated way, which is how the unit test is run, and so that passed. However, as soon as it was run with multiple revisions in a sequence the migration would fail with the message that the `db_dbgroup` table has pending event triggers as soon as the final instruction to change the nullability of the column was executed. The cause for this was never found. As an alternative, the migration is adapted to instead create the column directly as non-nullable, but also provide a server default. This will also avoid the exception of existing rows with a null value, just as the original approach, but now when we remove the server default in a second operation, we no longer hit the problem of the pending trigger events. 02 December 2020, 11:48:40 UTC
2b33b72 SqlAlchemy: improve the alembic migration code The code in `aiida.backends.sqlalchemy.manager` is used, among other things, to control the database migrations. It can be used to get info like the current revision of the database, current revision of the code and to actually migrate the database. The migrations are performed through `alembic`. This library has the somewhat weird approach of loading the `env.py` file, which then actually calls the migrations. This file somehow needs to get the configuration of the environment, for example the connection to the database, and it does so by loading it from the config that is imported. This config is actually built dynamically in the `SqlBackendManager`. The old implementation was correctly building up the configuration object but was then calling the CLI commands of `alembic` to perform the various operations, which was unnecessarily complex and inefficient. For most operations, essentially everything but performing the actual migrations, one can construct a `MigrationContext` directly, which allows to inspect the state of the database, for example to get the current database revision. For anything related to the revisions in the code, e.g., to get the current head of the code, we can instantiate an instance of the `ScriptDirectory` which allows one to inspect the available revisions. Through these changes, the `env.py` file is no longer loaded everytime, even when it is not necessary, such as when simply retrieving the current revision of the database. 02 December 2020, 11:48:40 UTC
6d8ec0b Config: do not overwrite when loaded and not migrated (#4605) The `Config.from_file` classmethod used to load the `config.json` file into memory was always writing the contents from memory to disk if it was read, even if the content was not migrated. This is unnecessary and so the write is now only performed if the config was migrated. 02 December 2020, 07:19:14 UTC
e303cc4 Dependencies: update minimum version for `notebook>=6.1.5` (#4593) Lower versions suffer from vulnerability `GHSA-c7vm-f5p4-8fqh`. Also update the requirement files to only use explicit pinned versions. The compatibility operator was erroneously used for the `aio-pika`, `pamqp` and `pytest-asyncio` dependencies. For `pamqp` the minimum required version is upped to `2.3` since that was the version that introduced the `support_deprecated_rabbitmq` function that is required from that library. 01 December 2020, 10:18:49 UTC
716a1d8 Engine: explicitly enable compatibility for RabbitMQ 3.5 RabbitMQ 3.6 changed the way integer values are interpreted for connection parameters. This would cause certain integer values that used to be perfectly acceptable, to all of suddent cause the declaration of resources, such as channels and queues, to fail. The library `pamqp`, that is used by `aiormq`, which in turn is used ultimately by `kiwipy` to communicate with the RabbitMQ server, adapted to these changes, but this would break code with RabbitMQ 3.5 that used to work just fine. For example, the message TTL when declaring a queue would now fail when `32767 < TTL < 655636` due to incorrect interpretation of the integer type. The library `pamqp` provides a way to enable compatibility with these older versions. One should merely call the method: pamqp.encode.support_deprecated_rabbitmq() This will enable the legacy integer conversion table and will restore functionality for RabbitMQ 3.5. 27 November 2020, 13:35:05 UTC
c75aeb4 Tests: do not create or destroy event loop in test setup/teardown 27 November 2020, 13:35:05 UTC
460b571 Engine: enable `plumpy`'s reentrant event loop policy The event loop implementation of `asyncio` does not allow to make the event loop to be reentrant, which essentially means that event loops cannot be nested. One event loop cannot be run within another event loop. However, this concept is crucial for `plumpy`'s design to work and was perfectly allowed by the previous event loop provider `tornado`. To work around this, `plumpy` uses the library `nest_asyncio` to patch the `asyncio` event loop and make it reentrant. The trick is that this should be applied at the correct time. Here we update the `Runner` to enable `plumpy`'s event loop policy, which will patch the default event loop policy. This location is chosen since any process in `aiida-core` *has* to be run by a `Runner` and only one runner instance will ever be created in a Python interpreter. When the runner shuts down, the event policy is reset to undo the patch. 27 November 2020, 13:35:05 UTC
281241c Engine: cancel active tasks when a daemon runner is shutdown When a daemon runner is started, the `SIGINT` and `SIGTERM` signals are captured to shutdown the runner before exiting the interpreter. However, the async tasks associated with the interpreter should be properly canceled first. 27 November 2020, 13:35:05 UTC
20300d2 `Runner`: use global event loop and global runner for process functions With the migration to `asyncio`, there is now only a single event loop that is made reentrant through the `nest-asyncio` library, that monkey patches `asyncio`'s built-in mechanism to prevent this. This means that in the `Runner` constructor, we should simply get the global event loop instead of creating a new one, if no explicit loop is passed into the constructor. This also implies that the runner should never take charge in closing the loop, because it no longer owns the global loop. In addition, process functions now simply use the global runner instead of creating a new runner. This used to be necessary because running in the same runner, would mean running in the same loop and so the child process would block the parent. However, with the new design on `asyncio`, everything runs in a single reentrant loop and so child processes no longer need to spawn their own independent nested runner. 27 November 2020, 13:35:05 UTC
cd0d15c Unwrap the futures returned by `ProcessController` in `verdi process` The commands of `verdi process` that perform an RPC on a live process will do so through the `ProcessController`, which returns a future. Currently, the process controller uses the `LoopCommunicator` as its communicator which adds an additional layer of wrapping. Ideally, the return type of the communicator should not change depending on the specific implementation that is used, however, for now that is the case and so the future needs to be unwrapped explicitly one additional time. Once the `LoopCommunicator` is fixed to return the same future type as the base `Communicator` class, this workaround can and should be removed. 27 November 2020, 13:35:05 UTC
8ea68f1 `Process.kill`: properly resolve the killing futures The result returned by `ProcessController.kill_process` that is called in `Process.kill` for each of its children, if it has any, can itself be a future, since the killing cannot always be performed directly, but instead will be scheduled in the event loop. To resolve the future of the main process, it will have to wait for the futures of all its children to be resolved as well. Therefore an intermediate future needs to be added that will be done once all child futures are resolved. 27 November 2020, 13:35:05 UTC
68f840d Engine: replace `tornado` with `asyncio` The `plumpy` and `kiwipy` dependencies have already been migrated from using `tornado` to the Python built-in module `asyncio` in the versions `0.16.0` and `0.6.0`, respectively. This allows us to also rid AiiDA of the `tornado` dependency, which has been giving requirement clashes with other tools, specifically from the Jupyter and iPython world. The final limitation was the `circus` library that is used to daemonize the daemon workers, which as of `v0.17.1` also supports `tornado~=5`. A summary of the changes: * Replace `tornado.ioloop` with `asyncio` event loop. * Coroutines are marked with `async` instead of decorated with the `tornado.gen.coroutine` decorator. * Replace `yield` with `await` when calling a coroutine. * Replace `raise tornado.gen.Return` with `return` when returning from a coroutine. * Replace `add_callback` call on event loop with `call_soon` when scheduling a callback. * Replace `add_callback` call on event loop with `create_task` when scheduling `process.step_until_terminated()`. * Replace `run_sync` call on event loop with `run_until_complete`. * Replace `pika` uses with `aio-pika` which is now used by the `plumpy` and `kiwipy` libraries. * Replace `concurrent.Future` with `asyncio.Future`. * Replace `yield tornado.gen.sleep` with `await asyncio.sleep`. Additional changes: * Remove the `tornado` logger from the logging configuration. * Remove the `logging.tornado_loglevel` configuration option. * Turn the `TransportQueue.loop` attribute from method into property. * Call `Communicator.close()` instead of `Communicator.stop()` in the `Manager.close()` method. The `stop` method has been deprecated in `kiwipy==0.6.0`. 27 November 2020, 13:35:05 UTC
af12a62 CI: Add workflow to run tests against various RabbitMQ versions The main test workflow runs against a single version of RabbitMQ but experience has shown that the code can break for different versions of the RabbitMQ server. Here we add a new CI workflow that runs various unit tests through pytest that simulate the typical interaction with the RabbitMQ server in normal AiiDA operation. The difference is that these are tested against the currently available versions of RabbitMQ. The current setup, still only tests part of the functionality that AiiDA uses, for example, the default credentials and virtual host are used. Connections over TLS are also not tested. These options would require the RabbitMQ service that is running in a docker container to be configured differently. It is not clear how these various options can be parametrized in concert with the actual unit tests. 27 November 2020, 12:40:52 UTC
149762c CI: revert apt source list removal This work around was added some time ago because this source for the `apt` package manager was causing the install of system dependencies to fail. 27 November 2020, 12:40:52 UTC
36cb133 Fix command for getting EBM config options (#4587) Currently the transport options for the EBM are obtained by using the get_config function, e.g.: `initial_interval = get_config_option(RETRY_INTERVAL_OPTION)` However, it seems that `get_config()` does not get you the current configuration (see #4586). Replacing `get_config().get_option()` with `get_config_option()` fixes this issue for the EBM options. 24 November 2020, 18:48:04 UTC
a2d6c76 Add options for transport tasks (#4583) * Add options for transport tasks When encountering failures during the execution of transport tasks, a runner will wait for a time interval between transport task attempts. This time interval between attempts is increased using an exponential backoff mechanism, i.e. the time interval is equal to: (TRANSPORT_TASK_RETRY_INITIAL_INTERVAL) * 2 ** (N_ATTEMPT - 1) where N_ATTEMPT is the number of failed attempts. This mechanism is interrupted once the TRANSPORT_TASK_MAXIMUM_ATTEMPTS is reached. The initial interval and maximum attempts are currently fixed to 20 seconds and 5, respectively. This commit adds two configuration options that use these defaults, but allow the user to adjust them using `verdi config`. 22 November 2020, 20:02:07 UTC
17b7718 `CalcJob`: add the `additional_retrieve_list` metadata option (#4437) This new option allows one to specify additional files to be retrieved on a per-instance basis, in addition to the files that are already defined by the plugin to be retrieved. This was often implemented by plugin packages itself through a `settings` node that supported a key that would allow a user to specify these additional files. Since this is a common use case, we implement this functionality on `aiida-core` instead to guarantee a consistent interface across plugins. 19 November 2020, 09:09:33 UTC
d29fb3b Improve `verdi node delete` performance (#4575) The `verdi node delete` process fully loaded all ORM objects at multiple stages during the process, which is highly inefficient. This commit ensures the process now only loads the PKs when possible. As an example, the time to delete 100 "empty" nodes (no attributes/objects) is now reduced from ~32 seconds to ~5 seconds. 18 November 2020, 11:30:38 UTC
20996d1 Fix `verdi --version` in editable mode (#4576) This commit fixes a bug, whereby click was using a version statically stored on install of the package. This meant changes to `__version__` were not dynamically reflected. 18 November 2020, 10:37:27 UTC
d0437c6 DOCS: Reverse daemon start and profile setup sections in intro. (#4574) The profile must be setup prior to starting the daemons to avoid an error. 18 November 2020, 09:52:02 UTC
1c48d71 `SinglefileData`: add support for `pathlib.Path` for `file` argument (#3614) 18 November 2020, 08:59:17 UTC
f04dbf1 Enforce verdi quicksetup --non-interactive (#4573) When in non-interactive mode, do not ask whether to use existing user/database 17 November 2020, 21:52:25 UTC
4c8f1b0 Docs: update citations with AiiDA workflows paper (#4568) Citation for the latest paper on the engine is added to the README and the documentation index page. The paper in `aiida/__init__.py` is also updated which was still referencing the original publication of 2016. 17 November 2020, 14:31:56 UTC
49cd0e7 CI: remove `run-on-comment` job in benchmark workflow (#4569) This job is failing due to this change: https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/ It's not really used, so lets just remove it 17 November 2020, 07:15:23 UTC
29c54b5 Dependencies: bump cryptography to 3.2 in `requirements` (#4520) Bumps `cryptography` from 2.8 to 3.2. Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Sebastiaan Huber <mail@sphuber.net> 16 November 2020, 07:16:44 UTC
4256360 Merge remote-tracking branch 'origin/master' into develop 13 November 2020, 15:57:45 UTC
f945dca Merge pull request #4516 from ramirezfranciscof/release/1.5.0 Release `v1.5.0` 13 November 2020, 15:02:44 UTC
539c0d7 Release `v1.5.0` 13 November 2020, 14:35:16 UTC
62ed643 REST API: Add full_types_count as new entry point This feature returns a namespace tree of the available node types in the database (data node_types + process process_types) with the addition of a count at each leaf / branch. It also has the option of doing so for a single user, if the pk is provided as an option. 13 November 2020, 14:34:26 UTC
9683716 REST API: Modify assumptions for `process_type` The `process_type` attribute has changed over the years; currently it must have some descriptor for processes and be None for data types. Apparently this has not only been the case, and thus old databases may have both data and process nodes with either empty strings ('') and/or None entries in their `process_type` attributes. Additionally, there were some problems with how the unregistered entry points were considered that made it impossible to query for them. In order to consider all of this when filtering and doing statistics, it has been decided to: 1) Group all instances of a given node_type that have either '' or None as their process_type in the same `full_type` (`node_type|` ) and hence always query for both when the `process_type` is missing. 2) Remove the `aiida.descriptor:` and the `no-entry-point` from the `process_type` part of unregistered processes. This was interfeering when the `full_type` was given to return the filtering options to query for these processes. Tests were adapted to test this new compatibility aspects. 13 November 2020, 14:34:26 UTC
810dc56 Update archive version: 0.9 -> 0.10 (#4561) Fixes a bug whereby archives created with the latest code fail to import in the last v1.4.2 release (if they contain group extras). This update imposes that these new archives are no longer compatible with v1.4.2 13 November 2020, 10:20:09 UTC
def9a03 Improve archive import memory usage (#4559) This commit is a small iterative improvement to the archive import logic, added to reduce memory overhead, by reducing the number of variables in memory at any one time 12 November 2020, 20:27:03 UTC
520bdbf Improve mypy type checking (#4553) This commit moves the mypy execution to run in the full aiida-core python environment. Currently, the mypy in the pre-commit is used as a "non-local" import and adds the blanket `--ignore-missing-imports` flag. This greatly reduces the effectiveness of the type checking, because it does not check any types from classes/functions imported from third-party packages. Similarly, adding `check_untyped_defs = True` improves the checking coverage (see https://mypy.readthedocs.io/en/stable/common_issues.html#no-errors-reported-for-obviously-wrong-code). 12 November 2020, 12:58:05 UTC
bd197f3 Archive export refactor (2) (#4534) This PR builds on #4448, with the goal of improving both the export writer API (allowing for "streamed" data writing) and performance of the export process (CPU and memory usage). The writer is now used as a context manager, rather than passing all data to it after extraction of the data from the AiiDA database. This means it is called throughout the export process, and will allow for less data to be kept in RAM when moving to a new archive format. The number of database queries has also been reduced, resulting in a faster process. Lastly, code for read/writes to the archive has been moved to the https://github.com/aiidateam/archive-path package. This standardises the interface for both zip and tar, and especially for export to tar, provides much improved performance, since the data is now written directly to the archive (rather than writing to a folder then only compressing at the end). Co-authored-by: Leopold Talirz <leopold.talirz@gmail.com> 12 November 2020, 10:45:40 UTC
008580e `verdi group delete`: deprecate and ignore the `--clear` option (#4357) Note that the option is still there but no longer makes a difference. It now merely prints a deprecation warning, but is otherwise ignored. The reason is that otherwise, users would be forced to continue to use it despite it raising a deprecation warning. The only danger is for users that have come to depend on the slightly weird behavior that in order to delete non-empty groups, one would have to pass them `--clear` option otherwise the command would fail. After this change, this would now delete the group without complaining, which may break this use case. This use case was estimate to be unlikely and so it was accepted to simply ignore the option. 11 November 2020, 17:05:13 UTC
c42a86b `SlurmScheduler`: fix bug in validation of job resources (#4555) The `SlurmJobResource` resource class used by the `SlurmScheduler` plugin contained a bug in the `validate_resources` methods that would cause a float value to be set for the `num_cores_per_mpiproc` field in certain cases. This would cause the submit script to fail because SLURM only accepts integers for the corresponding `--ncpus-per-task` flag. The reason is that the code was incorrectly using `isinstance(_, int)` to check that the divison of `num_cores_per_machine` over `num_mpiprocs_per_machine` is an integer. In addition to the negation missing in the conditional, this is not the correct way of checking whether a division is an integer. Instead it should check that the value is identical after it is cast to `int`. 11 November 2020, 15:35:16 UTC
ac4c881 Make process functions submittable (#4539) The limitation that process functions were not submittable, meaning they could not be sent to a daemon worker but could only be run by the current interpreter, was a historical one. Before the introduction of the system of processes in v1.0, a `calcfunction` was nothing more than the execution of a normal function. However, now, a process function creates a `Process` instance in the background, just as any other process. This means it can also be serialized and deserialized by a daemon worker. Here we remove the limitation of process functions not being submittable simply by removing the check. Note that there is no need to change the implementation other than adding two attributes on the decorated function that specify the corresponding process class and the method that allows to recreate the instance from the serialized instance. Co-authored-by: Sebastiaan Huber <mail@sphuber.net> 08 November 2020, 10:33:48 UTC
e5c2d0e Docs: fix white space in example yaml file from run_codes.rst (#4549) 07 November 2020, 17:05:33 UTC
5c12056 Docs: Revise "Get started" flow (#4496) This is a comprehensive revision of the "Get started" and "Advanced installation" page to address the issues identified in #4254 . In summary, the "Get started" page has been completely revised to provide a more linear flow for all supported setup flows and the "Detailed installation" has been largely pruned and renamed to "Advanced configuration" with most content directly incorporated into the linear setup flows. These are the changes in detail: - The "routes overview" panels have been revised to be simpler and more descriptive in their differences. - While the "routes overview" panels are still principally distinguished by "level of virtualization", the primary distinction between the first two supported installation methods ("system-wide installation" and "pure conda installation") is the path for installing prerequisite services, **not** whether the AiiDA Python package is installed into a virtual environment (via conda/venv). The primary difference here is that the first method requires administrative privileges, the latter does not. The revised descriptions should make this much clearer. - Each route panel is clickable and leads directly to a full guide for the specific route on a different page. - All routes are presented with a linear path, choices (e.g. operating system, Conda/pip) are represented via tabs. - Optional steps and potential issues are presented as drop-downs in order to incorporate them into the linear flow without being too distracting to those users where they don't apply. - No specific route is clearly recommend over another because it really depends on the user environment and use case. However the *system-wide installation* is likely most applicable to novice users who - given the presented options – are unsure about which route is best for them. This is based on the assumption that the alternative routes would likely not be applicable to those users who are unfamiliar with the mentioned technology in the first place. For example, a user should probably not take the docker route if they are unfamiliar with docker, however users who are familiar with docker, will likely be able to evaluate whether that is the right choice for them. The system-wide installation is therefore now explicitly recommended to those users *who are unsure* about which route is best for them. - The "Detailed Installation" page is renamed to "Advanced configuration". This is motivated by the fact that all supported setup routes are now fully covered on the "Getting started" page. Caveats and potential issues are by and large directly incorporated into those linear paths. The information found on the "Advanced configuration" page now covers edge cases for advanced users who want to further customize their setup or who have rare environmental conditions. The fact that the content of that chapter will likely not be applicable to most users is made explicit at the top of the page. - Slight duplication between different routes is deliberately tolerated to be able to represent a linear flow to users. - The instructions for the Windows Subsystem for Linux have been updated and now support both version 1 and 2. Co-authored-by: Dominik Gresch <a-dogres@microsoft.com> 06 November 2020, 16:23:27 UTC
64ae3c8 Merge remote-tracking branch 'origin/master' into develop 06 November 2020, 13:58:26 UTC
dfd1602 Merge pull request #4545 from aiidateam/release/1.4.3 Release `v1.4.3` 06 November 2020, 13:41:35 UTC
2d2ac39 Release `v1.4.3` 06 November 2020, 11:12:01 UTC
78cf6e1 Fix `UnboundLocalError` in `aiida.cmdline.utils.edit_multiline_template` (#4436) If `click.edit` returns a falsy value, the following conditional would be skipped and the `value` variable would be undefined causing an `UnboundLocalError` to be raised. This bug was reported by @blokhin but the exact conditions under which it occurred are not clear. Cherry-pick: 861a39f268954833385e699b3acbd092ccd04e5e 06 November 2020, 10:05:33 UTC
0a7039e RabbitMQ: remove validation of `broker_parameters` from profile (#4542) This validation was added as an attempt to help users with detecting invalid parameters in the `broker_parameters` dictionary of a profile, but `aiida-core` internally has no real limitations here. It is the libraries underneath that decide what is acceptable and this can differ from library to library plus it is not always clear. For example, currently we use `topika` and `pika` which behave different from `aiormq` which will be replacing them soon once `tornado` is replaced with `asyncio`. It is best to not limit the options on `aiida-core`'s side and just let it fail downstream as to not artificially limit the parameters that might be perfectly acceptable by the libraries downstream. 05 November 2020, 11:02:52 UTC
2c0f9a9 CI: Add official support for Python 3.9 (#4301) Updating of Conda in the `install-with-conda` job of the `test-install` workflow is disabled because it fails for as of yet unknown reasons. 05 November 2020, 10:05:04 UTC
06063e7 Docs: Move data types to Topics section (#4469) There was still content from the previous documentation on data types that was missing from the revamped docs. Here we move this content into the "Topics - Data types" section. Also, restructured the content to first discuss the 'core' types, which we intend to keep in aiida-core in the long term, then the 'materials science' types, which may be moved to a plugin at some point. Moved the export content to the end of the file. Additionally, written a short text for each data type, which can start from the "Aim" bullet point for each type. Moved the other bullet points into a table, perhaps one for the "Core" and "Materials design" types each. Showed some simple use cases (e.g. how to load a dictionary into a Dict node) for each of the data types. 04 November 2020, 19:09:50 UTC
eea2773 Docs: Add instructions on creating scheduler plugins (#4476) 03 November 2020, 14:51:06 UTC
d675574 Simplify Hill notation for `get_formula()` and add test (#4536) Simplify hill notation sorting (@csadorf) Add a test for `get_formula()` to test 'hill' and 'hill_compact' (@CasperWA) Co-authored-by: Carl Simon Adorf <csadorf@umich.edu> 03 November 2020, 13:35:22 UTC
8326050 Refactor archive migrations (#4532) This commit follows refactors to the archive writing and reading process, to provide an implementation agnostic interface for the migration of archives (i.e. independent of the internal structure of the archive). This will allow for subsequent changes to the archive format. To facilitate this: - `MIGRATE_FUNCTIONS` now includes both the to/from versions of the migration, - this allows for a change, from a recursive migration approach to pre-computing the migration pathway, then applying the migrations iteratively - this also allows for a progress bar of the migration steps - the signature of migration step functions has been changed, such that they now only receive the uncompressed archive folder, and not also specifically the `data.json` and `metadata.json` dictionaries. - instead, the folder is wrapped in a new `CacheFolder` class, which caches file writes in memory, such that reading of the files from the file system only happen once, and they are written after all the migrations have finished. - the `--verbose` flag has been added to `verdi export migrate`, to allow for control of the stdout message verbosity. - the extracting/compressing of tar/zip has been generalised into `archive/common.py`; `safe_extract_tar`, `safe_extract_zip`, `compress_folder_tar`, `compress_folder_zip`. These include callbacks, to be used by the progress reporter to create progress bars. - all migration unit tests have been converted to pytest Co-authored-by: Leopold Talirz <leopold.talirz@gmail.com> 03 November 2020, 09:31:07 UTC
9ff07c1 Add `reset` method to`ProgressReporterAbstract` (#4522) This PR adds the `update` method to the progress reporter. This in-turn, allows for the implementation of a callback mechanism in `ArchiveReaderAbstract.iter_node_repos`. The callback implementation is taken from the [disk-objectstore](https://github.com/aiidateam/disk-objectstore) package, and so facilitates a later migration to its use. The PR also moves the (common) repository import code out of the backend specific modules, reducing code duplication. 28 October 2020, 19:17:44 UTC
55f8706 Fix: Add missing entry point groups to the mapping (#4395) Some new entrypoints had been introduced, but they weren't in the mapping, so they couldn't be accessed for instance with `verdi plugin list`. 28 October 2020, 11:46:55 UTC
71566ae Docs: Add additional redirects (#4477) Add redirect in order to redirect known links and most viewed pages 28 October 2020, 08:31:43 UTC
4859572 Add group extras to archive (#4521) Group extras were introduced recently but not yet exported to AiiDA archives. This commit adds group extras to the AiiDA archive. Instead of special-casing deserialization of attributes and extras based on the field name, a `convert_type: "jsonb"` is introduced, which is used to indicate JSON-binary fields. 27 October 2020, 23:49:55 UTC
2f8e845 Refactor Import Archive (#4510) This commit builds on [c6d38c1](https://github.com/aiidateam/aiida-core/commit/c6d38c1657b65f540bea653f253920bb602c7ebc), to refactor the archive in order to decouple it from its export/import to the AiiDA database. The `aiida/tools/importexport/archive` module has been created, which contains the readers and writers used to create and interact with an archive. Effectively archive formats are now defined by their associated reader and writer classes, which must inherit and implement the `ArchiveReaderAbstract` and `ArchiveWriterAbstract` interfaces respectively. `aiida/tools/importexport/dbimport` has been refactored, to interface with this new `ArchiveReaderAbstract` class, and also utilise the new `progress_reporter` context manager. Both the django and sqlalchemy backends have been "synchronized", such that conform to exactly the same code structure, which in-turn has allowed for the sharing of common code. The commit is intended to be back-compatible, in that no public API elements have been removed. However, it does: - remove the `Archive` class, replaced by the `ReaderJsonZip`/`ReaderJsonTar` classes. - remove `aiida/tools/importexport/common/progress_bar.py`, now replaced by `aiida/common/progress_reporter.py` - move `aiida/tools/importexport/dbexport/zip.py` → `aiida/tools/importexport/common/zip_folder.py` The `aiida import --verbosity DEBUG` option has been added, which sets the log level of the process, and whether the progress bars are removed. The `verdi export inspect` code has also been refactored, to utilize the `ArchiveReaderAbstract`. The `verdi export inspect --data` option has been deprecated, since access to the `data.json` file is only an implementation detail of the current archive format. 27 October 2020, 21:18:15 UTC
02c8a0c FIX: Only remove temporary folder if it is present (#4379) This was causing an error, when running the tests/engine/test_calc_job.py on OSX, since here it is not guaranteed the temporary folder will be created. 27 October 2020, 18:53:31 UTC
9460e4e Revert PR #4416 (#4519) "`CalcJob`: support nested directories in target of `remote_copy/symlink_list` (#4416)" This reverts commit 16bc30548f7f1c686d200935174533535e850fd5. 27 October 2020, 15:02:28 UTC
57c8afa Improve the deprecation warning for `Node.open` outside context manager (#4434) The new warning now includes the offending line of code. 27 October 2020, 08:22:55 UTC
7c49471 `verdi migrate`: make `--in-place` work across different file systems (#4393) The `verdi migrate` command assumed implicitly that the archive that is to be migrated, resides on the same file system as the one that is used by the `tempfile` module. If this is not the case, the `os.rename` call used to atomically move the migrated archive to the original will fail with the exception: OSError: [Errno 18] Invalid cross-device link Changing `os.rename` to `shutil.move` fixes this problem. The downside, however, is that the move is no longer atomic, but that is probably why `os.rename` is restricted to same filysystem operations. 26 October 2020, 19:08:41 UTC
861a39f Fix `UnboundLocalError` in `aiida.cmdline.utils.edit_multiline_template` (#4436) If `click.edit` returns a falsy value, the following conditional would be skipped and the `value` variable would be undefined causing an `UnboundLocalError` to be raised. This bug was reported by @blokhin but the exact conditions under which it occurred are not clear. 26 October 2020, 15:40:42 UTC
ee13ad6 Docs: Add `verdi process status` command to tutorial (#4508) 26 October 2020, 11:23:40 UTC
e142124 Fix `ZeroDivisionError` in worker slots check (#4513) This was being raised if 0 slots were available 25 October 2020, 23:22:14 UTC
33c9f41 Refactor archive progress bar (#4504) This commit introduces a new generic progress reporter interface (in `aiida/common/progress_reporter.py`), that can be used for adding progress reporting to any process. It is intended to deprecate the existing `aiida/tools/importexport/common/progress_bar.py` module. The reporter is designed to work similar to logging, such that its "handler" is set external to the actual function, e.g. by the CLI. Its default implementation is to do nothing (a null reporter), and there is convenience function to set a [tqdm](https://tqdm.github.io/) progress bar implementation (`set_progress_bar_tqdm`). The reporter is intended to always be used as context manager, e.g. to allow the progress bar to be removed once the process is complete. The reporter has been implemented in the archive export module, and it is intended that it will also be implemented in the archive import module. At this point the existing `aiida/tools/importexport/common/progress_bar.py` module can be removed. 25 October 2020, 11:03:05 UTC
1be12e1 Pre-commit: reintroduce `pylint` rules (#4501) In 65ad067b18cffeb639994efe9a372ec1475e1615 the following `pylint` rules were accidentally disabled: * missing-class-docstring * missing-function-docstring * too-many-ancestors * too-many-locals This commit reintroduces all but the "too-many-ancestors" rule, which is most likely never going to be addressed. Having to change the depth of the MRO is not trivial and usually not that effective. 23 October 2020, 13:32:51 UTC
c6d38c1 Refactor the archive exporter (#4448) This commit refactors the export process (in a back-compatible manner), such that the extraction of data from the database is fully decoupled from the writing of that data to an archive. It allows for pluggable export writers, and is intended as a preliminary step toward the creation of a new archive format. The original `export_tree` function is renamed to `_collect_archive_data` and its contents split into a number of separate, self-contained, functions. The process control has then been inverted, such that the export data is parsed to the archive writer, rather than the export writer calling `export_tree` to generate that data. An abstract writer class is provided, then each concrete writer is identified and called for via a string (this could in fact be made into an entry point). Data is parsed to the writers contained in a [dataclasses](https://pypi.org/project/dataclasses/) container. This requires a backport for python 3.6, but is included in python core from python 3.7 onwards. The `extract_tree`, `extract_zip` and `extract_tar` functions are reimplemented, for backwards compatibility, but are marked as deprecated and to be remove in v2.0.0. Additional issues addressed: - fixes a bug, whereby, in python 3.8, `logging.disable(level=` has changed to `logging.disable(lvl=`. - fixes a bug, whereby the traversal rules summary was returning incorrect rule summaries. - adds mypy compliant typing (and adds the file to the pre-commit mypy list) Co-authored-by: Leopold Talirz <leopold.talirz@gmail.com> 23 October 2020, 00:12:16 UTC
228716f Docs: add "Internals - REST API" (#4492) This section explains the internals of the AiiDA REST API mechanics and how to extend it. The `developer_guide/core/extend_restapi.rst` is removed and its content has been moved to this new section and slightly improved. Given the plans to overhaul the REST API, these modifications were kept to a minimum so the section may have some not perfectly complete parts or a sub-optimal design. Co-authored-by: Giovanni Pizzi <gio.piz@gmail.com> Co-authored-by: ramirezfranciscof <ramirezfranciscof@users.noreply.github.com> 22 October 2020, 08:50:58 UTC
c8d583c Docs: merge REST API query instructions (#4493) Merge the instructions for querying the REST API into the new "How to share data" section; moving the details on pagination into the REST API reference. Also converted lists of filters and more to tables, sorting them alphabetically. Co-authored-by: Casper Welzel Andersen <43357585+CasperWA@users.noreply.github.com> 21 October 2020, 19:13:42 UTC
6b1958c Docs: Fix page not found redirect (#4498) 21 October 2020, 15:58:08 UTC
2eda24e Docs: serve a custom 404 page (#4478) Redirect to a helpful page when a document is not found. 21 October 2020, 14:34:13 UTC
3070610 Docs: add the "How to explore the provenance graph" section (#4491) This section adds completely new documentation on the graph exploring methods `get_incoming` and `get_outgoing` that were not yet documented. It also documents the `creator`, `caller` and `creator` properties that also weren't documented yet. The `working_with_aiida/resultmanager.rst` is removed and its content, that documents the `inputs` and `outputs` properties of process nodes as well as the `res` property of the `CalcJobNode` class, is added to the new section in heavily rewritten form. 21 October 2020, 13:59:01 UTC
09ac916 Docs: update REST API wsgi scripts (#4488) The wsgi scripts for deploying the AiiDA REST in production were outdated and are updated. The how-to on deploying your own REST API server is significantly streamlined and now includes the wsgi files as well as the examplary apache virtualhost configuration. Co-authored-by: Giovanni Pizzi <gio.piz@gmail.com> 20 October 2020, 20:08:45 UTC
191dc90 Docs: move list of public API to the "Reference" section (#4489) The `working_with_aiida/python_api.rst` is moved to the reference section. A new index page is created for the "AiiDA API" which allows to have a first page with the list of public facing API methods followed by the autogenerated complete API documentation. 20 October 2020, 14:06:58 UTC
941b8cc Docs: Remove `modifying_the_schema.rst` (#4490) It has been moved to the Github wiki. See: https://github.com/aiidateam/aiida-core/wiki/Modifying-the-database-schema 20 October 2020, 13:32:00 UTC
58eb4d3 Docs: add "How to interact with AiiDA" section (#4475) This section gives a high-level overview of the various methods with which can interact with AiiDA. For details it refers to relevant sections with more information. 20 October 2020, 13:19:17 UTC
cb268d1 replace all occurences of "export file" We have agreed on the terms "AiiDA archive (file)" and "AiiDA archive format". Co-authored-by: Casper Welzel Andersen <43357585+CasperWA@users.noreply.github.com> 20 October 2020, 12:46:44 UTC
e63fdeb Docs: add "How to share data" The "how to share data" section includes instructions both for dealing with AiiDA archives (e.g. for publishing AiiDA graphs alongside your publication) and for using the AiiDA REST API. Co-authored-by: Casper Welzel Andersen <43357585+CasperWA@users.noreply.github.com> 20 October 2020, 12:46:44 UTC
ce65988 Docs: move how-to write data plugin to topics (#4482) This information is felt to be too detailed for the how-to section and it breaks the flow too much. 20 October 2020, 12:21:48 UTC
5e0de12 Docs: add info on archive format to internals section (#4467) 20 October 2020, 11:02:10 UTC
back to top