-
Notifications
You must be signed in to change notification settings - Fork 192
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
Emit a warning when a node instance is set as input port default #3466
Emit a warning when a node instance is set as input port default #3466
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @sphuber ! Some minor suggestions on the PR itself.
Apart from this, I think before deciding whether to merge this we should try to collect input from a few plugin developers as well, since I suspect this change is going to affect a large number of people - and not just plugin developers, but also people who just write workflows.
Before this change, we are in a space where you can choose to use lambdas, but you can also choose not to.
In this change, we are saying: lambdas are the way to handle default values for ports with AiiDA data types (not yet enforced, but you'll get tedious warnings otherwise).
Are we sure this is the best solution going forward? If yes, fine to merge. If not, perhaps better to wait a bit?
I would be glad to get some feedback on this; e.g. from @giovannipizzi @greschd @dev-zero @chrisjsewell
aiida/engine/processes/ports.py
Outdated
def __init__(self, name, valid_type=None, help=None, default=ports.UNSPECIFIED, required=True, validator=None): | ||
"""Override the constructor to check the type of the default if set and warn if not immutable.""" | ||
# pylint: disable=redefined-builtin,too-many-arguments | ||
immutabe_types = (int, float, complex, tuple, frozenset, bytes, six.string_types) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you perhaps provide a reference where this list comes from?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... and: typo, should be immutable_types
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But I agree with @ltalirz: needs documentation, and I maybe implement it as a static function from the start since a candidate from Python 3.7 would be @dataclasses.dataclass(frozen=True)
decorated class?
There you don't get a type you could check against but would have to do a separate check (if isdataclass(...) and hasattr(..., '__setattr__')
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't find any definitive resource in the official python docs. I agree that this is fragile.
aiida/engine/processes/ports.py
Outdated
# to try and prevent that people set node instances as defaults. | ||
if default is not ports.UNSPECIFIED and not (callable(default) or isinstance(default, immutabe_types)): | ||
warnings.warn( | ||
'mutable default defined for port `{}` which is highly unadvisable. Please use an immutable ' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'mutable default defined for port `{}` which is highly unadvisable. Please use an immutable ' | |
'mutable default for port `{}` which can lead to unexpected side effects. Please use an immutable ' |
aiida/engine/processes/ports.py
Outdated
if default is not ports.UNSPECIFIED and not (callable(default) or isinstance(default, immutabe_types)): | ||
warnings.warn( | ||
'mutable default defined for port `{}` which is highly unadvisable. Please use an immutable ' | ||
'value instead or employ a lambda.'.format(name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'value instead or employ a lambda.'.format(name) | |
'value instead or employ a lambda function - e.g. replacing `Int(5)` with `lambda: Int(5)`.'.format(name) |
This suggestion might not be the final solution but I think if we want to force everybody to do this in their WorkChains we should try to give them a bit more of a hand.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also CalcJobs
. If you think this will help, we can put it in.
@@ -148,12 +148,12 @@ def define(cls, spec): | |||
help='Set the quality of service to use in for the queue on the remote computer') | |||
spec.input('metadata.options.withmpi', valid_type=bool, default=False, | |||
help='Set the calculation to use mpi',) | |||
spec.input('metadata.options.mpirun_extra_params', valid_type=(list, tuple), default=[], | |||
spec.input('metadata.options.mpirun_extra_params', valid_type=(list, tuple), default=list, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get what this does and that this is now no longer a "mutable" argument, but I believe this will be difficult to understand to new users.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is there to understand though? They won't look in the implementation I imagine and with the ProcessBuilder
auto help it will show default=list
, which seems fine no? Anyway, I wouldn't know how to solve this otherwise, because putting None
will break backwards-compatibility.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might sound silly, but maybe we could use default=list()
and default=dict()
? At least for me, the parentheses (is that the plural?) make it clearer that you are creating an empty list/dict and not passing the actual class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the problem is though, that as soon as you add the parentheses you are calling the callable and so you are instantiating it. That is exactly what we don't want to do. The builint list
is a callable and calling it like list()
creates an instance of that type. This is just the way python works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think part of why this might be hard to catch for new users is naming: The default
argument essentially combines the concepts of a default and a default_factory
(in the sense of defaultdict
or dataclasses.field
).
In my opinion the interface would be cleaner if the two concepts were separated, but for backwards compatibility I would only change this very slowly, if at all.
in general I fail to see how this fully solves #2515, allowing lambdas (or arbitrary callables for that matter) allow for any possible side-effect. What am I missing? |
It "solves" it as in it will instruct people not to do things that definitely lead to problems. I agree that it doesn't actually solve the underlying problem, but I am not sure that that is even possible. A similar problem can occur when a node is created in interpreter A, is loaded in B and then deleted. If A now accesses any attribute, it will also except. What should the behavior in this case be? Would it even be possible to catch this exception and handle in such a way that always provides a well defined solution? At least I don't know of one. |
Anyway, given that the effects of this change are quite uncertain, we should probably not include this now and push this until after the release. |
acebef0
to
f6f6efc
Compare
Ok to postpone emitting the warning if we are unsure (even if I don't see a real use case where this is a problem, but ok to double check with all developers first) - still, I would merge the replace of all other defaults with lambdas, because I think it's the right thing to do to avoid to essentially share the mutable among all classes. I post also this example for those who are not aware of this: def test_mutable(a=[]):
print(id(a), a)
a.append('1')
print(id(a), a)
if __name__ == "__main__":
test_mutable()
test_mutable() Result:
I.e., the default is instantiated once and reused between different calls. |
Well it certainly makes sense to me. Mutable default arguments, in python, are a definite no no, and using a default_factory is exactly what is now implemented in python 3.7's |
To be honest, I wouldn't have realized setting something like On the other hand, isn't an ORM data class supposed to be immutable (up to extras) once it's stored? In the Regarding the list of "immutable" types, it's not even always clear from the type if something is safe. For example, |
aiida/engine/processes/ports.py
Outdated
default = kwargs['default'] | ||
# If the default is specified and it is not a lambda (callable) nor an immutable type, raise a warning. | ||
# This is to try and prevent that people set node instances as defaults. | ||
if default is not ports.UNSPECIFIED and not (callable(default) or isinstance(default, immutabe_types)): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
btw, all the builtin types are callables, so this can be simplified to:
if default is not ports.UNSPECIFIED and not callable(default):
Yeh definitely don't do that lol. Remember the |
Well, the "clone" part should happen when the process is instantiated (not sure if this is even possible, though), so this would still give you separate nodes. But you're right, I hadn't read the issues leading up to this well enough - it wouldn't fix the issue of relying on nodes that would disappear after a DB wipe. |
@sphuber what is the status of this? I'm assuming the release mentioned was 1.0, which has already passed, correct? Is this something we should rebase and try to merge / further discuss in some meeting / discard? |
I had put it on hold because effectively we could not come to an agreement on what the behavior should be. To summarize: using mutable types as function defaults in python is not encouraged because it can have unexpected side-effects. For some similar (with subtle differences) reasons, it is better to also not use AiiDA nodes as defaults in process specification definitions, i.e.:
The reason is that with this approach the node All of this can be easily prevented by making the default a callable, for example with a lambda. The change is minimal:
The default value is just prefixed with
I propose we vote here, please put your name where applicable:
|
A middle ground would be warning only on the AiiDA node defaults - I think this part is less controversial, and we don't have to go into how to determine if a general Python object is mutable. If you won't allow that option in the vote, I'd go with "in favor". |
Given the problems people are facing with compiling the documentation on RTD, which mostly stem from this issue, I agree that issuing a warning would be practically useful at this point (even if I still find the need to pass lambdas not very elegant... not that I have a better solution either, though). |
(1) @sphuber : I see the problem clearly with the aiida nodes, but why is this discouraged for all mutable types? (I'm thinking of lists vs tuples here, correct?) (2) @ltalirz @greschd The lambda thing seems to be kind of a "hack" to go around the warning, but if I'm not mistaken what we are ultimately trying to encourage here is the use of immutable types, so technically the way to really ("officially"?) solve the warning is to change to an immutable type for the default. Can you think of an example where this would not be possible? |
Executing the function twice consecutively will give a different behavior. This is what is meant with "unexpected behavior" when using mutable types for function defaults.
I wouldn't call it a hack. The |
The important bit of the lambda solution is that the "function body" is not executed when the class is defined, but only when the process is constructed. This solves the problem in two ways:
|
Yes, yes, that's what I meant with tuples vs list as my go-to example for immutable vs mutable.
Woah, ok, I would not have expected that behavior. I'm not sure in what kind of situations this behavior would be the desired one (it looks like the |
Pylint does do this, but only when it's actually in a function definition. Here it's passed as a "regular" parameter to the |
There are some cases where you actually want that behavior (to keep state between function calls). But more than that, it's a (slightly inconvenient) consequence of "everything is an object", and the way function arguments are passed in Python (by binding a new name to an existing object). I don't want to take this thread entirely off the rails, but just to clarify this: Python does not distinguish between immutable or mutable objects when calling a function, they are treated the same. The difference is that immutable objects have no mutating methods. It's almost impossible to make a custom class immutable, but there are things like And on the other hand, even for built-ins it's hard to check if something is completely immutable. A In [12]: def print_something(l=tuple([[]])):
...: l[0].append('a')
...: print(l)
...:
In [13]: print_something()
(['a'],)
In [14]: print_something()
(['a', 'a'],) |
I guess the other persons with a strong opinion last time around were @chrisjsewell and @dev-zero with the former being in favor of the warning and the latter against. If @dev-zero is ok with a warning for AiiDA nodes, then I think we can move ahead with that one. That seems like the best and safest option right now |
f6f6efc
to
9b8caf1
Compare
9b8caf1
to
37d6af9
Compare
@greschd @ltalirz I have reduced the scope of the warning to only node instances and rebased the PR. The comment by Leopold about the new defaults for the |
Yep the warning only for nodes sounds good 👍 , as all mutable type would just be too hard to assess. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good, just a small comment on one of the tests.
@@ -382,7 +382,7 @@ def presubmit(self, folder): | |||
for key, value in job_tmpl.job_resource.items(): | |||
subst_dict[key] = value | |||
mpi_args = [arg.format(**subst_dict) for arg in computer.get_mpirun_command()] | |||
extra_mpirun_params = self.node.get_option('mpirun_extra_params') # same for all codes in the same calc | |||
extra_mpirun_params = self.node.get_option('mpirun_extra_params') or [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Side note: If this is a common idiom, we might want to add a default
keyword argument to get_option
also.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, the get_attribute
that it calls through to already has this. Don't want to change that in this PR though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @sphuber - just one question
@@ -382,7 +382,7 @@ def presubmit(self, folder): | |||
for key, value in job_tmpl.job_resource.items(): | |||
subst_dict[key] = value | |||
mpi_args = [arg.format(**subst_dict) for arg in computer.get_mpirun_command()] | |||
extra_mpirun_params = self.node.get_option('mpirun_extra_params') # same for all codes in the same calc | |||
extra_mpirun_params = self.node.get_option('mpirun_extra_params') or [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering a bit - doesn't it make sense to have the default value specified in the port itself rather than outside?
In the mode above, anyone using the port has to "know" what the default value is.
I.e. I guess in the current port syntax, default=lambda: []
is perhaps the way to go...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I realized another disadvantage of specifying an empty list or dictionary as default, by doing that, each CalcJobNode
will always have those attributes, even though they are almost always empty.
{
"environment_variables": {},
"mpirun_extra_params": [],
}
By not specifying "empty" defaults, we prevent these unnecessary attributes. The same actually goes for all other options with "empty" defaults, like prepend_text
and append_text
. Thinking about it now, maybe I should not change this behavior in this PR but we should think about this whether this is desirable behavior. I will implement the change you proposed and then open an issue
Using mutable objects as defaults for `InputPorts` can lead to unexpected result and should be discouraged. Implementing this for all types, including python builtins such as lists and dictionaries, is difficult and not the most pressing problem. The biggest problem is users specifying node instances as defaults. This will cause the backend to be loaded just when the process class is imported, which can cause problems during the building of documentation and with unit testing where instances in memory to deleted nodes can be referenced, among other things. To warn users for these complications, we override the `InputPort` constructor to check the type of the default and emit a warning if it is a node instance. The `CalcJob` implementation had to be adapted to conform with the new requirements as the `mpirun_extra_params` and `environment_variables` metadata options were using mutable types for their default. Just as certain test process classes, the defaults are now prefixed with the `lambda` keyword.
37d6af9
to
425d39d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good for me, but let's wait for @ltalirz to check if his comment was resolved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all good to go, thanks guys!
To comply with the update aiidateam/aiida-core#3466 we here incorporate lambda on all input nodes that are of an AiiDA data type. This is done to make it clear that we want to supply a immutable object as input. This also fixes the problem of not being able to run consequetive workchain tests, so in this PR all of the present workchain tests are finally enabled. In addition this PR fixes the previous problems of not being able to build RTD due to the need of a backend. Please consult aiidateam/aiida-core#3466 and reference therein for additional details.
To comply with the update aiidateam/aiida-core#3466 we here incorporate lambda on all input nodes that are of an AiiDA data type. This is done to make it clear that we want to supply a immutable object as input. This also fixes the problem of not being able to run consequetive workchain tests, so in this PR all of the present workchain tests are finally enabled. In addition this PR fixes the previous problems of not being able to build RTD due to the need of a backend. Please consult aiidateam/aiida-core#3466 and reference therein for additional details.
* Updated metaclass dependency to comply with the updated in aiida_core * Fixed failure to import AbstractNodeMeta for release Aiida version * Removed explicit version numbering as this was only recently added to the develop branch with version number 1.0.0a2. Instead we now check with a try and use the old metaclass definition of we see an ImportError * Updated docstring * Updated test to use the new Aiida function get_strict_version (#171) * Updated test to use the new Aiida function get_strict_version. * Fixed the test again to account for the fact that the version function is of course not available for earlier Aiida versions * Fixed formatting issues * Pre-commit was not working right in fork. Now formating should be valid. * Updated in order to avoid has_finished call * Corrected the update * Updated correction for has_finished to use the implemented change in develop * Added parser quantities to output_parameters (#219) * Added parser quantities to output_parameters * Minor correction to naming scheme * Update localhost fixture for the new backend interface (#223) * Update localhost fixture for the new backend interface * Use most recent version of aiida_core develop for the dev tests * Test complex workchains by mocking their sub workchains * Created a new Module for WorkChain related fixtures. * Workchains suggestions (#192) * Changed location of workflows and workchains, added a verify and converge workchain. * Fixed a few mistakes that happended during merge * Minor compliance fixes * Fixed a few issues * Updated the tests * Updated the workchain tests to only run on Ubuntu using the distro package * Added a file that performs first convergence tests and then relaxation * Added an auxiliary function to separate the use of potcar in the workchain * Updated tests * Updated the tests again * Updated the tests again to enable relaxation * Moved creation of output_parameters to results in the relax workchain * Added a test that checks that the structure from the POSCAR/CONTCAR parser is the same as from the xml parser * Added test file * Changed name of test data directory of the relax workchain test * Submitting a test to verify mock-vasp locations on Travis * Updated workchains to comply with tests. * Fixed parsevasp dependency * Updated the check for has_finished to exit_status * Cleaned up location of a few code segments and their location * Updated name on tests * Added a test to see if output_chgcar is in the output of a standard execution of a VASP workchain * Moved utilitarian functions to utils.workchains to comply with current structure * Fixed docstring * Refactored some code in the convergence workchain and fixed a few statements to comply standards in Aiida and the plugin * Updated the convergence test and applied a few bugfixes that was discovered during testing * Added testfile for convergence tests * Updated formatting * Updated formatting to comply with new yapf version * Final updates * Updated localhost fixture to comply updates in Aiida develop * Updated tox to use recent Aiida * Put the test for the convergence workchain to xfail since Travis does not support runs over 10 min which are silent. * Updated convergence test to skip. * Updated test of the relax workchain * Removed some redundant methods * Updated workchains, added new test and test data * Enable longer than 10 minute runs on Travis (now 20 minutes) (#226) * Enable longer than 10 minute runs on Travis (now 20 minutes) * Updated Travis config to explicitly remove Postgresql 9.2 * Updated Travis config again * Updated calls to parsevasp to utilize Aiida logger (#225) * Updated (#227) Thanks Rico! * relax-wc _set_ibrion to -1 only when p,s,v all False (#228) * Fix verifynextwc docstrings (#230) * Updated * Updated docstring and made the verify_next_workchain methods more consistent * Fix force fetching (#231) * Updated * Added support for extraction of forces * Added a test for the return of the stress * Fixed formatting * Fixed formatting * Renamed files of the parser settings and manager and fixed the entry for the stress * Final fix of formatting after yapf version change * Lock tests a4 (#234) * Updated * Locked down development tests to aiida a4 * Updated the Travis config file * Updated the Travis config file * Updated the Travis config file * Added strpath to the version updater * Formatting and pytest version in line with Aiida * Updated to code comply with the changes in the versions * Updated lockdown of ASE version which caused issues. * Documentation to kick-start AiiDA-VASP calculation (#235) Thanks a lot Togo! * Add an example of submitting non-workflow calculation (#233) * Add an example of submitting non-workflow calculation * Fixed formatting. Fixed formatting due to yapf version change. * Fix immigrant when POTCAR exists (#232) Thanks for the contribution Togo. * Support for bandstructure (#239) * Updated * Added export outputs to the workchains and started to work on a workchain to extract the bandstructure * Added support for extraction of the band structure using SeeKPath * Removed check of ADDITIONAL_RETREIVE_LIST due to failing tests. * Added check for settings in the convergence workchain. * Added a test for the band structure workchain * Updated the relative tolerance * Updated parsevasp 0.2.19 requirement (#240) * Updated * Updated requirement of parsevasp to 0.2.19 * Parser: custom node support + adding a node composer (#204) * Add support for custom nodes * Added a NodeComposer * Renamed parsers.output_node_definitons to parsers.node_composer * Update IncarParser and test_relax_wf * Updated mock_vasp.py with short-cut property for IncarParser * Unified the interface for 'add_node_name' in 'parser_settings' * Update VaspImmigrant for using the node_composer short cuts * Added a test for potential future conflicts with parsevasp * Rework of the conistency test * Updated DoscarParser test for the node_composer * Updated 'test_parameter_results' after merge * Updated * Merged with develop and removed pre-commit from Travis until they release an issue which fixes the depreciated no-ri option * Fixed unstable test condition for the band structure workchain * Another try on unstable test condition for the band structure workchain * Yet another update for the test * Removing rtol as it is not necessary * Commenting out the test that fails on Travis. Numpy version? * New outcar parser (#247) * Updated * Almost done with the OUTCAR parser * Updated parsevasp version dependency to 0.2.21 * Added a test that checks extraction on both OUTCAR and vasprun.xml * Removed erroneous comments * Added test files * Support for epsilon (#248) * Added test files * Added support for extraction of epsilon and epsilon_ion from the xml parser * Removed spurious file * Fix parser inconsistencies (#249) * Added test files * Removed alternative quantities for the energies and added the relay of forces and stress to the VASP workchain, which was missing * Removed a spurious file, and corrected the symmetry parser to comply with the present updates of parsevasp (#250) * Migration beta (#282) * Added test files * Start of conversion to AiiDA beta * Fixed pre-commit, prospector and yaml version to AiiDA beta * Updated docstring to reflect name change from ParameterData to Dict * Updated remaining files to Python3 * Updated the data class fetchers to use dict instead of parameter * Fixed load of Code * Removed get_file_abs_path, except for the parser. Temp fix which uses the open from SinglefileData and writes the new files. * Updated user and authinfo fetching to comply with AiiDA beta spec * Added local_copy_list due to the removal of the absolute paths for SinglefileData * Removed old legacy backendtests which has not been used for a while. * Moved io folder to a file_parsers folder under parsers * Added file parser tests * Added back the check for the basic datatypes when calling get_data_node and get_data_class * Updated the parser for Aiida 1.0 * Added test to check that we get the correct class and instance using get_data_class and get_data_node * Relaced database load function with decorator * Updated a few tests * Fixing python 3 deprecated .im_func. * Updated the parser tests * Merging changes back * Remove IncarIo and fixed the INCAR parser tests * Name change from KpParser to KpointsParser * Update python 2, 3 * Replaced get_attrs and updated KPOINTS parser * Fixed the test for the OUTCAR parser * Fixed aiida_env on file parsers * Moved the old querybuild from old AiiDA into aiida_utils * Repairing test_vasp_parser * Migrated PotcarData * Fixing data/tests and utils/tests * Fixed the calculation tests * Moved the StringIO check by six to the import module level * Added str to convert Path to string before passing it to Folder * Fixed default user check for test cases * Workchain fixes * Fixed typo on the exit status, basic workchain now runs * Updated relax and the base workchain to work with AiiDA beta * Updated convergence workchain and package dependencies * Fixed remaining iteritems * Locked down to latest AiiDA beta * Changed default exit status from None to ERROR_UNKNOWN * Fixed exit_codes * Fixed basestring * Updated parsevasp dependency and calcfunction fix to converge workchain * Further fixes on the workchains * Updated the immigrator * Inherit from VaspCalculation in order to avoid multiple defines * Updated immigrator to pass the test * Updated error codes for potentials and fixed interface of immigrator * Fixed passing of parameters * Removed tuple on kind name to be consistent with calculation * Fixed typo * Updated withmpi to be set to True unless explicitly set by user * Changed from md5 to sha512 checks on the potentials * Updated node configuration to include forces and stress * Fixed typos * Remove output_ from the output nodes * Updated README * Updated parsevasp dependency * Moved the INCAR parser to parsevasp and got rid of the legacy INCAR parser * Fixed logger instance passing and parser settings. - Fixed passing of the AiiDA logger instance to parsevasp in order to avoid DEBUG printouts from AiiDA (parsevasp sets the default logger if it does not receive a logger instance). - Removed parsing of the structure for the static run that follows a relaxation. - Fixed some linting. * Added energy and force cutoff to the relaxation workchain * Added check for AttributeError to the relaxation parameters * Enabled return of exit codes from the Parser * Unified workchain tests * Fixed potential import in immigrator * Migration beta (#275) * Fix immigrant to get potential_mapping correctly * Removed unnecessary lines * Fixed the calcfunction in the convergence test * Code cleanup and parsevasp 0.4.0 dependency * Updated parsevasp dependency to 0.4.1 * Fixed renaming of Group.name to Group.label in AiiDA * Updated authors and contributers * Updated parsevasp dependency to 0.4.2 * Updated dependencies * Updated documentation and docstrings * Added requirements file for docs * Removed requirements file * Modified existing requirements file * Added readthedocs config file * Updated requirements to include atomic_tools for aiida-core * Added requirements.txt file * Moved the readthedocs.yml file to root * Updated readthedocs.yml file * Updated readthedocs.yml file * Updated readthedocs.yml file * Pinned sphinx version for readthedocs * Updated readthedocs.yml file * Updated port name from parameter to misc * Renamed kickstart tutorial to conda tutorial and linked * Fixed wrong ExitCode import * Renamed tutorial file * Updated documentation * Update documents (#279) * Update conda.rst * Collection of minor updates of documentation * Update example scripts of relax and verify workchains * Added git describe to doc versioning * Removed Python 2.7 tests * Changed from trusty to xenial for Python 3.7 * Reverting to default location og pg_ctl * Dropping Python 3 tests to 3.6 * Added RabbitMQ as a service at Travis * Updated docstrings * Updated import of fixtures * Enable access to localhost on Travis * Execute permission on bash script * Added RabbitMQ package to Xenial on Travis * Added aiida-vasp as requirements for RTD * Added https for aiida-vasp * Added backend config for docs * Added tutorial section to the documentation * Add bulk modulus workchain * Add tutorial of running vasp taking example of bulk modulus calculation * Add tutorial of python/aiida tips before running vasp * Update bulk modulus workchain, now it works at a marginal level * Reset parameter on final static calculation * Preparing for release 0.3.0 (#283) * Update bulk modulus workchain following the update of relax workchain * Removed AiiDA Sphinx in wait for update in core code * Remove bulk modulus workchain * Removed apidoc * Updated tutorial document * Updated tutorial document * Added the aiida.sphinx extension again * Removed the aiida.sphinxext * Updated tutorial document * Updated tutorial document to SnO2 from AlN * Added tutorial potentials and doc * Added AiiDA config files for tutorial * Updated the setup instructions * Changed formatting of the initial setup * Tutorial documentation update by replacing example with SnO2 to wurtzite-type SiC * Updated documentation examples with numbering * Updated the bulk modulus tutorial * Added run_vasp files * Updated the documentation * Updated documentation * Update documentation * Updated documentation * Updated documentation * Updated documentation * Updated documentation * Updated documentation * Updated documentation * Updated documentation * Updated documentation * Updated documentation * Updated documentation * Updated the documentation * Update tutorial documentation of bulk modulus workchain * Update tutorial documentation of bulk modulus workchain * Update tutorial documentation of bulk modulus script * Updated documentation * Updated documentation * Updated documentation * Updated documentation * Updated documentation * Minor documentation fixes (#284) * Added sphinx rtd in requirement.txt as it's used by default in the docs Makefile * Fixed misindentation in doc page on adding a code * Updated documentation, linting and cookiecutter - Added a cookiecutter recipe for workchains - Updated the documentation - Added the fcc Si tutorial from the VASP wiki - Added rst pre-commit checks and updated the pre-commit checks in general * Removed legacy runwf from setup.json * Updated documentation * Updated documentation * Changed input namespaces for the workchains * Updating documentation * Fixed a bug in the convergence workchain and namespace setup * Updated bands workchain namespace * Updated additional namespaces * Removed parsing of CHGCAR and replaced it with a restart * Updated restart from charge density behavior when extracting bands * Updated the documentation, relinked install of plugin * Updated master workchain to support dos extraction * Updated test for relax workchain * Updated bands and relax workchain test * Removed six dependency and fixed workchain tests * Remove band workchain from running tests * Removed pg_ctl and account names * Changed yapf formatting after version pinning * Added version printouts to Travis config file * Updated pre-commit config due to invalid keys * Updated core dependency and removed old extra * Added D415 isolation to prospector * Added prospector in separate repo of pre-commit * Updated documentation and removed D205 in docstrings * Remove root_dir fetcher from fixture manager * Cleaned AiiDA environments on tests and updated manager * Updated fixture manager to use new fixture interface * Added in missing geometry relaxation modes (#285) The ability to relax the cell shape and volume or just the volume were missing from the convergence workflow. These have been added in, corresponding to a VASP ISIF settin of 6 or 7, respectively. Also raising more meaningful exception if an unsupported combination of relaxation options is passed. Test added. * Remove redundant with_dbenvs * Added how to run tests to the documentation * Added file containing the running tests documentation * Introduced retrieve_temporary_list (#288) In order to enable automatic deletion of files after parsing `retrieve_temporary_list` is available in AiiDA. This replaced the `retrieve_list` which do not delete any file after parsing is completed. The current behavior is that all files are delated after parsing unless specific filenames are added using `ADDITIONAL_RETRIEVE_LIST`. * Fixed issue with analysing positional lengths in relaxation workchain (#290) * Fixed issue with analysing positional lengths in relaxation workchain Due to nan entries the `max` function failed and the relaxation workchain did not work as expected. This is now fixed, we keep the nan, but act on the raised `RuntimeWarning` from numpy and set force the convergence to not be complete if this in encountered. An update to the plane wave and k-point convergence workchain is also performed in order to enable a final run using relaxation and the converged plane wave and k-point cutoffs. * Fixed the positional convergence test * Updated parsevasp dependency and fixed semantics in doc (#292) * Updated help text for POTCAR handling (#293) * Updated to account for all VASP output files (#295) * Fixed wrong call to nanmax (#296) * Updated convergence data output to rest in the converge namespace (#298) * Changed ISIF from 1 to 2 (#300) * Fixed problem of relaxation override (#302) * symbols should be stored by set_attribute for TrajectoryData. (#303) * symbols should be stored by set_attribute for TrajectoryData. * Add docstring on _compose_array_trajectory * Disabled D416 to enable numpydoc * Replaced old convergence_data (#309) * Compatibility with AiiDA 1.1.0 (#312) * Compatibility with AiiDA 1.1.0 In this commit we clean up the package dependencies such that we strictly follow AiiDA versioning also on the development and testing part which makes it easier to perform development on both aiida-core and aiida-vasp. In addition, liniting was redone to suite updated versions. Note that we had to disable the immigrator tests since they got stuck forever. Solving this is left as an issue. * Added parallel flag to coverage config * Generalization of workchains (#314) In order to open for the use of the workchains in other codes, we here decouple the workchains and the VASP specific parameters. In the workchains we use AiiDA/workchain specific parameters, which is translated at the code specific workchain in the workchain stack to code specific parameters. This concept can also be utilized by other codes. * Excluded the POTCAR file from the storage in the repository (#315) * Add lambda on input defaults (#316) To comply with the update aiidateam/aiida-core#3466 we here incorporate lambda on all input nodes that are of an AiiDA data type. This is done to make it clear that we want to supply a immutable object as input. This also fixes the problem of not being able to run consequetive workchain tests, so in this PR all of the present workchain tests are finally enabled. In addition this PR fixes the previous problems of not being able to build RTD due to the need of a backend. Please consult aiidateam/aiida-core#3466 and reference therein for additional details. * Make sure always retrieve files are stored by default (#322) * Make sure always retrieve files are stored by default The always retrieve files are now stored as a default. This can be changed by setting ALWAYS_STORE to False in the settings, or as before specify ALWAYS_RETRIEVE_LIST and ALWAYS_RETRIEVE_TEMPORARY_LIST, also in settings. A few tests to tests different combinations have been introduced. * Pinned to AiiDA 1.1 due to issue 323 * Removed print * With the recent aiidateam/aiida-core#3935 #323 is not strictly necessary and we can lift the pinning to AiiDA core 1.1. (#326) Thanks @atztogo. * #320 related stuff and other minor fixes (#321) * Making parser work when no temporary folder The parser can handle the case there is to no temporary retrieve folder. But it would throw an error code. This commit let it throw the error only when both retrieve folders are not present. This also allows parsing exising calcjobs using `VaspParser.parse_from_node`. * Warn if `parser_name` is not defined * Fix a bug where massage does not work with uppercased keys * Fix linter warnings * Let VaspCalculation default to use vasp.vasp parser * VaspWorkChain no longer sets parser_name updated test Co-authored-by: Espen <espen.flage-larsen@sintef.no> * Fixed immigrator by adding explicit call to presubmit (#334) * Fixed immigrator by adding explicit call to presubmit * Updating return values due to pending PR in AiiDA core * Added AiiDA trove classifier (#340) * Fixed migration of the Wannier90 interface (#341) * Update tutorial documents (#344) * fix tab-completion * example for SGE * fix tutorials numbering * remove account name and fix attribute name * Fixed skipped test for band workchain (#343) * Fixed skipped test for band workchain * Moved bands related parameters to the parameter massager * Added additional tests for smearing, charge and bands parameters * Moved override input parameters into a namespace (#348) In order to be able to check any supplied override parameters we needed to move these into a dedicated namespace. This namespace, now also corresponds well to the workchain where the conversion takes place. * Catch invalid INCAR tags (#333) * Catch invalid INCAR tags * Added checking of invalid INCAR for ParametersMassage * Updated tests and removed redundant namespace list Co-authored-by: espenfl <espen.flage-larsen@sintef.no> * Added sphinxcontrib-details-directive to requirements (#350) * Remove coverage combine as we are only building one report (#351) * Updated travis and tox settings (#352) * Enabled GitHub Actions workflow and Codecov (#353) * Added Codecov badge and removed Coveralls (#354) * Added Codecov badge and removed Coveralls * Added codecov config file to enable status check * Enabled the remaining code for coverage analysis (#355) * Enabled the remaining code for coverage analysis * Updated codecov config * Removed fix for repo * Updated the setup json file (#357) * Updated the readme to include more badges (#358) * Added badges into a table (#359) * Update documentation (#361) * Removed warning for included POTCAR and minor fixes in doc * Added note about incomplete doc of workchains * Parsing of the magnetization and magnetization node (#360) * Adding parsing of the magnetization * Adding the site magnetization as its own node in the output * Added tests for the parsing of the magnetization * Fixed too long line * Fixed linting * Changed the magnetization tests so that they use only a single parsing function Co-authored-by: espenfl <espen.flage-larsen@sintef.no> Co-authored-by: mcallsen <35340473+mcallsen@users.noreply.github.com> Co-authored-by: Jason.Yu <morty.yu@yahoo.com> Co-authored-by: Atsushi Togo <atz.togo@gmail.com> Co-authored-by: Martin Uhrin <martin.uhrin@gmail.com> Co-authored-by: Bonan Zhu <33688599+zhubonan@users.noreply.github.com> Co-authored-by: Kohei Shinohara <kohei19950508@gmail.com> Co-authored-by: Jonathan Chico <37243453+JPchico@users.noreply.github.com>
* Updated metaclass dependency to comply with the updated in aiida_core * Fixed failure to import AbstractNodeMeta for release Aiida version * Removed explicit version numbering as this was only recently added to the develop branch with version number 1.0.0a2. Instead we now check with a try and use the old metaclass definition of we see an ImportError * Updated docstring * Updated test to use the new Aiida function get_strict_version (#171) * Updated test to use the new Aiida function get_strict_version. * Fixed the test again to account for the fact that the version function is of course not available for earlier Aiida versions * Fixed formatting issues * Pre-commit was not working right in fork. Now formating should be valid. * Updated in order to avoid has_finished call * Corrected the update * Updated correction for has_finished to use the implemented change in develop * Added parser quantities to output_parameters (#219) * Added parser quantities to output_parameters * Minor correction to naming scheme * Update localhost fixture for the new backend interface (#223) * Update localhost fixture for the new backend interface * Use most recent version of aiida_core develop for the dev tests * Test complex workchains by mocking their sub workchains * Created a new Module for WorkChain related fixtures. * Workchains suggestions (#192) * Changed location of workflows and workchains, added a verify and converge workchain. * Fixed a few mistakes that happended during merge * Minor compliance fixes * Fixed a few issues * Updated the tests * Updated the workchain tests to only run on Ubuntu using the distro package * Added a file that performs first convergence tests and then relaxation * Added an auxiliary function to separate the use of potcar in the workchain * Updated tests * Updated the tests again * Updated the tests again to enable relaxation * Moved creation of output_parameters to results in the relax workchain * Added a test that checks that the structure from the POSCAR/CONTCAR parser is the same as from the xml parser * Added test file * Changed name of test data directory of the relax workchain test * Submitting a test to verify mock-vasp locations on Travis * Updated workchains to comply with tests. * Fixed parsevasp dependency * Updated the check for has_finished to exit_status * Cleaned up location of a few code segments and their location * Updated name on tests * Added a test to see if output_chgcar is in the output of a standard execution of a VASP workchain * Moved utilitarian functions to utils.workchains to comply with current structure * Fixed docstring * Refactored some code in the convergence workchain and fixed a few statements to comply standards in Aiida and the plugin * Updated the convergence test and applied a few bugfixes that was discovered during testing * Added testfile for convergence tests * Updated formatting * Updated formatting to comply with new yapf version * Final updates * Updated localhost fixture to comply updates in Aiida develop * Updated tox to use recent Aiida * Put the test for the convergence workchain to xfail since Travis does not support runs over 10 min which are silent. * Updated convergence test to skip. * Updated test of the relax workchain * Removed some redundant methods * Updated workchains, added new test and test data * Enable longer than 10 minute runs on Travis (now 20 minutes) (#226) * Enable longer than 10 minute runs on Travis (now 20 minutes) * Updated Travis config to explicitly remove Postgresql 9.2 * Updated Travis config again * Updated calls to parsevasp to utilize Aiida logger (#225) * Updated (#227) Thanks Rico! * relax-wc _set_ibrion to -1 only when p,s,v all False (#228) * Fix verifynextwc docstrings (#230) * Updated * Updated docstring and made the verify_next_workchain methods more consistent * Fix force fetching (#231) * Updated * Added support for extraction of forces * Added a test for the return of the stress * Fixed formatting * Fixed formatting * Renamed files of the parser settings and manager and fixed the entry for the stress * Final fix of formatting after yapf version change * Lock tests a4 (#234) * Updated * Locked down development tests to aiida a4 * Updated the Travis config file * Updated the Travis config file * Updated the Travis config file * Added strpath to the version updater * Formatting and pytest version in line with Aiida * Updated to code comply with the changes in the versions * Updated lockdown of ASE version which caused issues. * Documentation to kick-start AiiDA-VASP calculation (#235) Thanks a lot Togo! * Add an example of submitting non-workflow calculation (#233) * Add an example of submitting non-workflow calculation * Fixed formatting. Fixed formatting due to yapf version change. * Fix immigrant when POTCAR exists (#232) Thanks for the contribution Togo. * Support for bandstructure (#239) * Updated * Added export outputs to the workchains and started to work on a workchain to extract the bandstructure * Added support for extraction of the band structure using SeeKPath * Removed check of ADDITIONAL_RETREIVE_LIST due to failing tests. * Added check for settings in the convergence workchain. * Added a test for the band structure workchain * Updated the relative tolerance * Updated parsevasp 0.2.19 requirement (#240) * Updated * Updated requirement of parsevasp to 0.2.19 * Parser: custom node support + adding a node composer (#204) * Add support for custom nodes * Added a NodeComposer * Renamed parsers.output_node_definitons to parsers.node_composer * Update IncarParser and test_relax_wf * Updated mock_vasp.py with short-cut property for IncarParser * Unified the interface for 'add_node_name' in 'parser_settings' * Update VaspImmigrant for using the node_composer short cuts * Added a test for potential future conflicts with parsevasp * Rework of the conistency test * Updated DoscarParser test for the node_composer * Updated 'test_parameter_results' after merge * Updated * Merged with develop and removed pre-commit from Travis until they release an issue which fixes the depreciated no-ri option * Fixed unstable test condition for the band structure workchain * Another try on unstable test condition for the band structure workchain * Yet another update for the test * Removing rtol as it is not necessary * Commenting out the test that fails on Travis. Numpy version? * New outcar parser (#247) * Updated * Almost done with the OUTCAR parser * Updated parsevasp version dependency to 0.2.21 * Added a test that checks extraction on both OUTCAR and vasprun.xml * Removed erroneous comments * Added test files * Support for epsilon (#248) * Added test files * Added support for extraction of epsilon and epsilon_ion from the xml parser * Removed spurious file * Fix parser inconsistencies (#249) * Added test files * Removed alternative quantities for the energies and added the relay of forces and stress to the VASP workchain, which was missing * Removed a spurious file, and corrected the symmetry parser to comply with the present updates of parsevasp (#250) * Migration beta (#282) * Added test files * Start of conversion to AiiDA beta * Fixed pre-commit, prospector and yaml version to AiiDA beta * Updated docstring to reflect name change from ParameterData to Dict * Updated remaining files to Python3 * Updated the data class fetchers to use dict instead of parameter * Fixed load of Code * Removed get_file_abs_path, except for the parser. Temp fix which uses the open from SinglefileData and writes the new files. * Updated user and authinfo fetching to comply with AiiDA beta spec * Added local_copy_list due to the removal of the absolute paths for SinglefileData * Removed old legacy backendtests which has not been used for a while. * Moved io folder to a file_parsers folder under parsers * Added file parser tests * Added back the check for the basic datatypes when calling get_data_node and get_data_class * Updated the parser for Aiida 1.0 * Added test to check that we get the correct class and instance using get_data_class and get_data_node * Relaced database load function with decorator * Updated a few tests * Fixing python 3 deprecated .im_func. * Updated the parser tests * Merging changes back * Remove IncarIo and fixed the INCAR parser tests * Name change from KpParser to KpointsParser * Update python 2, 3 * Replaced get_attrs and updated KPOINTS parser * Fixed the test for the OUTCAR parser * Fixed aiida_env on file parsers * Moved the old querybuild from old AiiDA into aiida_utils * Repairing test_vasp_parser * Migrated PotcarData * Fixing data/tests and utils/tests * Fixed the calculation tests * Moved the StringIO check by six to the import module level * Added str to convert Path to string before passing it to Folder * Fixed default user check for test cases * Workchain fixes * Fixed typo on the exit status, basic workchain now runs * Updated relax and the base workchain to work with AiiDA beta * Updated convergence workchain and package dependencies * Fixed remaining iteritems * Locked down to latest AiiDA beta * Changed default exit status from None to ERROR_UNKNOWN * Fixed exit_codes * Fixed basestring * Updated parsevasp dependency and calcfunction fix to converge workchain * Further fixes on the workchains * Updated the immigrator * Inherit from VaspCalculation in order to avoid multiple defines * Updated immigrator to pass the test * Updated error codes for potentials and fixed interface of immigrator * Fixed passing of parameters * Removed tuple on kind name to be consistent with calculation * Fixed typo * Updated withmpi to be set to True unless explicitly set by user * Changed from md5 to sha512 checks on the potentials * Updated node configuration to include forces and stress * Fixed typos * Remove output_ from the output nodes * Updated README * Updated parsevasp dependency * Moved the INCAR parser to parsevasp and got rid of the legacy INCAR parser * Fixed logger instance passing and parser settings. - Fixed passing of the AiiDA logger instance to parsevasp in order to avoid DEBUG printouts from AiiDA (parsevasp sets the default logger if it does not receive a logger instance). - Removed parsing of the structure for the static run that follows a relaxation. - Fixed some linting. * Added energy and force cutoff to the relaxation workchain * Added check for AttributeError to the relaxation parameters * Enabled return of exit codes from the Parser * Unified workchain tests * Fixed potential import in immigrator * Migration beta (#275) * Fix immigrant to get potential_mapping correctly * Removed unnecessary lines * Fixed the calcfunction in the convergence test * Code cleanup and parsevasp 0.4.0 dependency * Updated parsevasp dependency to 0.4.1 * Fixed renaming of Group.name to Group.label in AiiDA * Updated authors and contributers * Updated parsevasp dependency to 0.4.2 * Updated dependencies * Updated documentation and docstrings * Added requirements file for docs * Removed requirements file * Modified existing requirements file * Added readthedocs config file * Updated requirements to include atomic_tools for aiida-core * Added requirements.txt file * Moved the readthedocs.yml file to root * Updated readthedocs.yml file * Updated readthedocs.yml file * Updated readthedocs.yml file * Pinned sphinx version for readthedocs * Updated readthedocs.yml file * Updated port name from parameter to misc * Renamed kickstart tutorial to conda tutorial and linked * Fixed wrong ExitCode import * Renamed tutorial file * Updated documentation * Update documents (#279) * Update conda.rst * Collection of minor updates of documentation * Update example scripts of relax and verify workchains * Added git describe to doc versioning * Removed Python 2.7 tests * Changed from trusty to xenial for Python 3.7 * Reverting to default location og pg_ctl * Dropping Python 3 tests to 3.6 * Added RabbitMQ as a service at Travis * Updated docstrings * Updated import of fixtures * Enable access to localhost on Travis * Execute permission on bash script * Added RabbitMQ package to Xenial on Travis * Added aiida-vasp as requirements for RTD * Added https for aiida-vasp * Added backend config for docs * Added tutorial section to the documentation * Add bulk modulus workchain * Add tutorial of running vasp taking example of bulk modulus calculation * Add tutorial of python/aiida tips before running vasp * Update bulk modulus workchain, now it works at a marginal level * Reset parameter on final static calculation * Preparing for release 0.3.0 (#283) * Update bulk modulus workchain following the update of relax workchain * Removed AiiDA Sphinx in wait for update in core code * Remove bulk modulus workchain * Removed apidoc * Updated tutorial document * Updated tutorial document * Added the aiida.sphinx extension again * Removed the aiida.sphinxext * Updated tutorial document * Updated tutorial document to SnO2 from AlN * Added tutorial potentials and doc * Added AiiDA config files for tutorial * Updated the setup instructions * Changed formatting of the initial setup * Tutorial documentation update by replacing example with SnO2 to wurtzite-type SiC * Updated documentation examples with numbering * Updated the bulk modulus tutorial * Added run_vasp files * Updated the documentation * Updated documentation * Update documentation * Updated documentation * Updated documentation * Updated documentation * Updated documentation * Updated documentation * Updated documentation * Updated documentation * Updated documentation * Updated documentation * Updated documentation * Updated the documentation * Update tutorial documentation of bulk modulus workchain * Update tutorial documentation of bulk modulus workchain * Update tutorial documentation of bulk modulus script * Updated documentation * Updated documentation * Updated documentation * Updated documentation * Updated documentation * Minor documentation fixes (#284) * Added sphinx rtd in requirement.txt as it's used by default in the docs Makefile * Fixed misindentation in doc page on adding a code * Updated documentation, linting and cookiecutter - Added a cookiecutter recipe for workchains - Updated the documentation - Added the fcc Si tutorial from the VASP wiki - Added rst pre-commit checks and updated the pre-commit checks in general * Removed legacy runwf from setup.json * Updated documentation * Updated documentation * Changed input namespaces for the workchains * Updating documentation * Fixed a bug in the convergence workchain and namespace setup * Updated bands workchain namespace * Updated additional namespaces * Removed parsing of CHGCAR and replaced it with a restart * Updated restart from charge density behavior when extracting bands * Updated the documentation, relinked install of plugin * Updated master workchain to support dos extraction * Updated test for relax workchain * Updated bands and relax workchain test * Removed six dependency and fixed workchain tests * Remove band workchain from running tests * Removed pg_ctl and account names * Changed yapf formatting after version pinning * Added version printouts to Travis config file * Updated pre-commit config due to invalid keys * Updated core dependency and removed old extra * Added D415 isolation to prospector * Added prospector in separate repo of pre-commit * Updated documentation and removed D205 in docstrings * Remove root_dir fetcher from fixture manager * Cleaned AiiDA environments on tests and updated manager * Updated fixture manager to use new fixture interface * Added in missing geometry relaxation modes (#285) The ability to relax the cell shape and volume or just the volume were missing from the convergence workflow. These have been added in, corresponding to a VASP ISIF settin of 6 or 7, respectively. Also raising more meaningful exception if an unsupported combination of relaxation options is passed. Test added. * Remove redundant with_dbenvs * Added how to run tests to the documentation * Added file containing the running tests documentation * Introduced retrieve_temporary_list (#288) In order to enable automatic deletion of files after parsing `retrieve_temporary_list` is available in AiiDA. This replaced the `retrieve_list` which do not delete any file after parsing is completed. The current behavior is that all files are delated after parsing unless specific filenames are added using `ADDITIONAL_RETRIEVE_LIST`. * Fixed issue with analysing positional lengths in relaxation workchain (#290) * Fixed issue with analysing positional lengths in relaxation workchain Due to nan entries the `max` function failed and the relaxation workchain did not work as expected. This is now fixed, we keep the nan, but act on the raised `RuntimeWarning` from numpy and set force the convergence to not be complete if this in encountered. An update to the plane wave and k-point convergence workchain is also performed in order to enable a final run using relaxation and the converged plane wave and k-point cutoffs. * Fixed the positional convergence test * Updated parsevasp dependency and fixed semantics in doc (#292) * Updated help text for POTCAR handling (#293) * Updated to account for all VASP output files (#295) * Fixed wrong call to nanmax (#296) * Updated convergence data output to rest in the converge namespace (#298) * Changed ISIF from 1 to 2 (#300) * Fixed problem of relaxation override (#302) * symbols should be stored by set_attribute for TrajectoryData. (#303) * symbols should be stored by set_attribute for TrajectoryData. * Add docstring on _compose_array_trajectory * Disabled D416 to enable numpydoc * Replaced old convergence_data (#309) * Compatibility with AiiDA 1.1.0 (#312) * Compatibility with AiiDA 1.1.0 In this commit we clean up the package dependencies such that we strictly follow AiiDA versioning also on the development and testing part which makes it easier to perform development on both aiida-core and aiida-vasp. In addition, liniting was redone to suite updated versions. Note that we had to disable the immigrator tests since they got stuck forever. Solving this is left as an issue. * Added parallel flag to coverage config * Generalization of workchains (#314) In order to open for the use of the workchains in other codes, we here decouple the workchains and the VASP specific parameters. In the workchains we use AiiDA/workchain specific parameters, which is translated at the code specific workchain in the workchain stack to code specific parameters. This concept can also be utilized by other codes. * Excluded the POTCAR file from the storage in the repository (#315) * Add lambda on input defaults (#316) To comply with the update aiidateam/aiida-core#3466 we here incorporate lambda on all input nodes that are of an AiiDA data type. This is done to make it clear that we want to supply a immutable object as input. This also fixes the problem of not being able to run consequetive workchain tests, so in this PR all of the present workchain tests are finally enabled. In addition this PR fixes the previous problems of not being able to build RTD due to the need of a backend. Please consult aiidateam/aiida-core#3466 and reference therein for additional details. * Make sure always retrieve files are stored by default (#322) * Make sure always retrieve files are stored by default The always retrieve files are now stored as a default. This can be changed by setting ALWAYS_STORE to False in the settings, or as before specify ALWAYS_RETRIEVE_LIST and ALWAYS_RETRIEVE_TEMPORARY_LIST, also in settings. A few tests to tests different combinations have been introduced. * Pinned to AiiDA 1.1 due to issue 323 * Removed print * With the recent aiidateam/aiida-core#3935 #323 is not strictly necessary and we can lift the pinning to AiiDA core 1.1. (#326) Thanks @atztogo. * #320 related stuff and other minor fixes (#321) * Making parser work when no temporary folder The parser can handle the case there is to no temporary retrieve folder. But it would throw an error code. This commit let it throw the error only when both retrieve folders are not present. This also allows parsing exising calcjobs using `VaspParser.parse_from_node`. * Warn if `parser_name` is not defined * Fix a bug where massage does not work with uppercased keys * Fix linter warnings * Let VaspCalculation default to use vasp.vasp parser * VaspWorkChain no longer sets parser_name updated test Co-authored-by: Espen <espen.flage-larsen@sintef.no> * Fixed immigrator by adding explicit call to presubmit (#334) * Fixed immigrator by adding explicit call to presubmit * Updating return values due to pending PR in AiiDA core * Added AiiDA trove classifier (#340) * Fixed migration of the Wannier90 interface (#341) * Update tutorial documents (#344) * fix tab-completion * example for SGE * fix tutorials numbering * remove account name and fix attribute name * Fixed skipped test for band workchain (#343) * Fixed skipped test for band workchain * Moved bands related parameters to the parameter massager * Added additional tests for smearing, charge and bands parameters * Moved override input parameters into a namespace (#348) In order to be able to check any supplied override parameters we needed to move these into a dedicated namespace. This namespace, now also corresponds well to the workchain where the conversion takes place. * Catch invalid INCAR tags (#333) * Catch invalid INCAR tags * Added checking of invalid INCAR for ParametersMassage * Updated tests and removed redundant namespace list Co-authored-by: espenfl <espen.flage-larsen@sintef.no> * Added sphinxcontrib-details-directive to requirements (#350) * Remove coverage combine as we are only building one report (#351) * Updated travis and tox settings (#352) * Enabled GitHub Actions workflow and Codecov (#353) * Added Codecov badge and removed Coveralls (#354) * Added Codecov badge and removed Coveralls * Added codecov config file to enable status check * Enabled the remaining code for coverage analysis (#355) * Enabled the remaining code for coverage analysis * Updated codecov config * Removed fix for repo * Updated the setup json file (#357) * Updated the readme to include more badges (#358) * Added badges into a table (#359) * Update documentation (#361) * Removed warning for included POTCAR and minor fixes in doc * Added note about incomplete doc of workchains * Parsing of the magnetization and magnetization node (#360) * Adding parsing of the magnetization * Adding the site magnetization as its own node in the output * Added tests for the parsing of the magnetization * Fixed too long line * Fixed linting * Changed the magnetization tests so that they use only a single parsing function Co-authored-by: espenfl <espen.flage-larsen@sintef.no> * Preparing for release 1.0.0 Co-authored-by: mcallsen <35340473+mcallsen@users.noreply.github.com> Co-authored-by: Jason.Yu <morty.yu@yahoo.com> Co-authored-by: Atsushi Togo <atz.togo@gmail.com> Co-authored-by: Martin Uhrin <martin.uhrin@gmail.com> Co-authored-by: Bonan Zhu <33688599+zhubonan@users.noreply.github.com> Co-authored-by: Kohei Shinohara <kohei19950508@gmail.com> Co-authored-by: Jonathan Chico <37243453+JPchico@users.noreply.github.com>
* Updated metaclass dependency to comply with the updated in aiida_core * Fixed failure to import AbstractNodeMeta for release Aiida version * Removed explicit version numbering as this was only recently added to the develop branch with version number 1.0.0a2. Instead we now check with a try and use the old metaclass definition of we see an ImportError * Updated docstring * Updated test to use the new Aiida function get_strict_version (#171) * Updated test to use the new Aiida function get_strict_version. * Fixed the test again to account for the fact that the version function is of course not available for earlier Aiida versions * Fixed formatting issues * Pre-commit was not working right in fork. Now formating should be valid. * Updated in order to avoid has_finished call * Corrected the update * Updated correction for has_finished to use the implemented change in develop * Added parser quantities to output_parameters (#219) * Added parser quantities to output_parameters * Minor correction to naming scheme * Update localhost fixture for the new backend interface (#223) * Update localhost fixture for the new backend interface * Use most recent version of aiida_core develop for the dev tests * Test complex workchains by mocking their sub workchains * Created a new Module for WorkChain related fixtures. * Workchains suggestions (#192) * Changed location of workflows and workchains, added a verify and converge workchain. * Fixed a few mistakes that happended during merge * Minor compliance fixes * Fixed a few issues * Updated the tests * Updated the workchain tests to only run on Ubuntu using the distro package * Added a file that performs first convergence tests and then relaxation * Added an auxiliary function to separate the use of potcar in the workchain * Updated tests * Updated the tests again * Updated the tests again to enable relaxation * Moved creation of output_parameters to results in the relax workchain * Added a test that checks that the structure from the POSCAR/CONTCAR parser is the same as from the xml parser * Added test file * Changed name of test data directory of the relax workchain test * Submitting a test to verify mock-vasp locations on Travis * Updated workchains to comply with tests. * Fixed parsevasp dependency * Updated the check for has_finished to exit_status * Cleaned up location of a few code segments and their location * Updated name on tests * Added a test to see if output_chgcar is in the output of a standard execution of a VASP workchain * Moved utilitarian functions to utils.workchains to comply with current structure * Fixed docstring * Refactored some code in the convergence workchain and fixed a few statements to comply standards in Aiida and the plugin * Updated the convergence test and applied a few bugfixes that was discovered during testing * Added testfile for convergence tests * Updated formatting * Updated formatting to comply with new yapf version * Final updates * Updated localhost fixture to comply updates in Aiida develop * Updated tox to use recent Aiida * Put the test for the convergence workchain to xfail since Travis does not support runs over 10 min which are silent. * Updated convergence test to skip. * Updated test of the relax workchain * Removed some redundant methods * Updated workchains, added new test and test data * Enable longer than 10 minute runs on Travis (now 20 minutes) (#226) * Enable longer than 10 minute runs on Travis (now 20 minutes) * Updated Travis config to explicitly remove Postgresql 9.2 * Updated Travis config again * Updated calls to parsevasp to utilize Aiida logger (#225) * Updated (#227) Thanks Rico! * relax-wc _set_ibrion to -1 only when p,s,v all False (#228) * Fix verifynextwc docstrings (#230) * Updated * Updated docstring and made the verify_next_workchain methods more consistent * Fix force fetching (#231) * Updated * Added support for extraction of forces * Added a test for the return of the stress * Fixed formatting * Fixed formatting * Renamed files of the parser settings and manager and fixed the entry for the stress * Final fix of formatting after yapf version change * Lock tests a4 (#234) * Updated * Locked down development tests to aiida a4 * Updated the Travis config file * Updated the Travis config file * Updated the Travis config file * Added strpath to the version updater * Formatting and pytest version in line with Aiida * Updated to code comply with the changes in the versions * Updated lockdown of ASE version which caused issues. * Documentation to kick-start AiiDA-VASP calculation (#235) Thanks a lot Togo! * Add an example of submitting non-workflow calculation (#233) * Add an example of submitting non-workflow calculation * Fixed formatting. Fixed formatting due to yapf version change. * Fix immigrant when POTCAR exists (#232) Thanks for the contribution Togo. * Support for bandstructure (#239) * Updated * Added export outputs to the workchains and started to work on a workchain to extract the bandstructure * Added support for extraction of the band structure using SeeKPath * Removed check of ADDITIONAL_RETREIVE_LIST due to failing tests. * Added check for settings in the convergence workchain. * Added a test for the band structure workchain * Updated the relative tolerance * Updated parsevasp 0.2.19 requirement (#240) * Updated * Updated requirement of parsevasp to 0.2.19 * Parser: custom node support + adding a node composer (#204) * Add support for custom nodes * Added a NodeComposer * Renamed parsers.output_node_definitons to parsers.node_composer * Update IncarParser and test_relax_wf * Updated mock_vasp.py with short-cut property for IncarParser * Unified the interface for 'add_node_name' in 'parser_settings' * Update VaspImmigrant for using the node_composer short cuts * Added a test for potential future conflicts with parsevasp * Rework of the conistency test * Updated DoscarParser test for the node_composer * Updated 'test_parameter_results' after merge * Updated * Merged with develop and removed pre-commit from Travis until they release an issue which fixes the depreciated no-ri option * Fixed unstable test condition for the band structure workchain * Another try on unstable test condition for the band structure workchain * Yet another update for the test * Removing rtol as it is not necessary * Commenting out the test that fails on Travis. Numpy version? * New outcar parser (#247) * Updated * Almost done with the OUTCAR parser * Updated parsevasp version dependency to 0.2.21 * Added a test that checks extraction on both OUTCAR and vasprun.xml * Removed erroneous comments * Added test files * Support for epsilon (#248) * Added test files * Added support for extraction of epsilon and epsilon_ion from the xml parser * Removed spurious file * Fix parser inconsistencies (#249) * Added test files * Removed alternative quantities for the energies and added the relay of forces and stress to the VASP workchain, which was missing * Removed a spurious file, and corrected the symmetry parser to comply with the present updates of parsevasp (#250) * Migration beta (#282) * Added test files * Start of conversion to AiiDA beta * Fixed pre-commit, prospector and yaml version to AiiDA beta * Updated docstring to reflect name change from ParameterData to Dict * Updated remaining files to Python3 * Updated the data class fetchers to use dict instead of parameter * Fixed load of Code * Removed get_file_abs_path, except for the parser. Temp fix which uses the open from SinglefileData and writes the new files. * Updated user and authinfo fetching to comply with AiiDA beta spec * Added local_copy_list due to the removal of the absolute paths for SinglefileData * Removed old legacy backendtests which has not been used for a while. * Moved io folder to a file_parsers folder under parsers * Added file parser tests * Added back the check for the basic datatypes when calling get_data_node and get_data_class * Updated the parser for Aiida 1.0 * Added test to check that we get the correct class and instance using get_data_class and get_data_node * Relaced database load function with decorator * Updated a few tests * Fixing python 3 deprecated .im_func. * Updated the parser tests * Merging changes back * Remove IncarIo and fixed the INCAR parser tests * Name change from KpParser to KpointsParser * Update python 2, 3 * Replaced get_attrs and updated KPOINTS parser * Fixed the test for the OUTCAR parser * Fixed aiida_env on file parsers * Moved the old querybuild from old AiiDA into aiida_utils * Repairing test_vasp_parser * Migrated PotcarData * Fixing data/tests and utils/tests * Fixed the calculation tests * Moved the StringIO check by six to the import module level * Added str to convert Path to string before passing it to Folder * Fixed default user check for test cases * Workchain fixes * Fixed typo on the exit status, basic workchain now runs * Updated relax and the base workchain to work with AiiDA beta * Updated convergence workchain and package dependencies * Fixed remaining iteritems * Locked down to latest AiiDA beta * Changed default exit status from None to ERROR_UNKNOWN * Fixed exit_codes * Fixed basestring * Updated parsevasp dependency and calcfunction fix to converge workchain * Further fixes on the workchains * Updated the immigrator * Inherit from VaspCalculation in order to avoid multiple defines * Updated immigrator to pass the test * Updated error codes for potentials and fixed interface of immigrator * Fixed passing of parameters * Removed tuple on kind name to be consistent with calculation * Fixed typo * Updated withmpi to be set to True unless explicitly set by user * Changed from md5 to sha512 checks on the potentials * Updated node configuration to include forces and stress * Fixed typos * Remove output_ from the output nodes * Updated README * Updated parsevasp dependency * Moved the INCAR parser to parsevasp and got rid of the legacy INCAR parser * Fixed logger instance passing and parser settings. - Fixed passing of the AiiDA logger instance to parsevasp in order to avoid DEBUG printouts from AiiDA (parsevasp sets the default logger if it does not receive a logger instance). - Removed parsing of the structure for the static run that follows a relaxation. - Fixed some linting. * Added energy and force cutoff to the relaxation workchain * Added check for AttributeError to the relaxation parameters * Enabled return of exit codes from the Parser * Unified workchain tests * Fixed potential import in immigrator * Migration beta (#275) * Fix immigrant to get potential_mapping correctly * Removed unnecessary lines * Fixed the calcfunction in the convergence test * Code cleanup and parsevasp 0.4.0 dependency * Updated parsevasp dependency to 0.4.1 * Fixed renaming of Group.name to Group.label in AiiDA * Updated authors and contributers * Updated parsevasp dependency to 0.4.2 * Updated dependencies * Updated documentation and docstrings * Added requirements file for docs * Removed requirements file * Modified existing requirements file * Added readthedocs config file * Updated requirements to include atomic_tools for aiida-core * Added requirements.txt file * Moved the readthedocs.yml file to root * Updated readthedocs.yml file * Updated readthedocs.yml file * Updated readthedocs.yml file * Pinned sphinx version for readthedocs * Updated readthedocs.yml file * Updated port name from parameter to misc * Renamed kickstart tutorial to conda tutorial and linked * Fixed wrong ExitCode import * Renamed tutorial file * Updated documentation * Update documents (#279) * Update conda.rst * Collection of minor updates of documentation * Update example scripts of relax and verify workchains * Added git describe to doc versioning * Removed Python 2.7 tests * Changed from trusty to xenial for Python 3.7 * Reverting to default location og pg_ctl * Dropping Python 3 tests to 3.6 * Added RabbitMQ as a service at Travis * Updated docstrings * Updated import of fixtures * Enable access to localhost on Travis * Execute permission on bash script * Added RabbitMQ package to Xenial on Travis * Added aiida-vasp as requirements for RTD * Added https for aiida-vasp * Added backend config for docs * Added tutorial section to the documentation * Add bulk modulus workchain * Add tutorial of running vasp taking example of bulk modulus calculation * Add tutorial of python/aiida tips before running vasp * Update bulk modulus workchain, now it works at a marginal level * Reset parameter on final static calculation * Preparing for release 0.3.0 (#283) * Update bulk modulus workchain following the update of relax workchain * Removed AiiDA Sphinx in wait for update in core code * Remove bulk modulus workchain * Removed apidoc * Updated tutorial document * Updated tutorial document * Added the aiida.sphinx extension again * Removed the aiida.sphinxext * Updated tutorial document * Updated tutorial document to SnO2 from AlN * Added tutorial potentials and doc * Added AiiDA config files for tutorial * Updated the setup instructions * Changed formatting of the initial setup * Tutorial documentation update by replacing example with SnO2 to wurtzite-type SiC * Updated documentation examples with numbering * Updated the bulk modulus tutorial * Added run_vasp files * Updated the documentation * Updated documentation * Update documentation * Updated documentation * Updated documentation * Updated documentation * Updated documentation * Updated documentation * Updated documentation * Updated documentation * Updated documentation * Updated documentation * Updated documentation * Updated the documentation * Update tutorial documentation of bulk modulus workchain * Update tutorial documentation of bulk modulus workchain * Update tutorial documentation of bulk modulus script * Updated documentation * Updated documentation * Updated documentation * Updated documentation * Updated documentation * Minor documentation fixes (#284) * Added sphinx rtd in requirement.txt as it's used by default in the docs Makefile * Fixed misindentation in doc page on adding a code * Updated documentation, linting and cookiecutter - Added a cookiecutter recipe for workchains - Updated the documentation - Added the fcc Si tutorial from the VASP wiki - Added rst pre-commit checks and updated the pre-commit checks in general * Removed legacy runwf from setup.json * Updated documentation * Updated documentation * Changed input namespaces for the workchains * Updating documentation * Fixed a bug in the convergence workchain and namespace setup * Updated bands workchain namespace * Updated additional namespaces * Removed parsing of CHGCAR and replaced it with a restart * Updated restart from charge density behavior when extracting bands * Updated the documentation, relinked install of plugin * Updated master workchain to support dos extraction * Updated test for relax workchain * Updated bands and relax workchain test * Removed six dependency and fixed workchain tests * Remove band workchain from running tests * Removed pg_ctl and account names * Changed yapf formatting after version pinning * Added version printouts to Travis config file * Updated pre-commit config due to invalid keys * Updated core dependency and removed old extra * Added D415 isolation to prospector * Added prospector in separate repo of pre-commit * Updated documentation and removed D205 in docstrings * Remove root_dir fetcher from fixture manager * Cleaned AiiDA environments on tests and updated manager * Updated fixture manager to use new fixture interface * Added in missing geometry relaxation modes (#285) The ability to relax the cell shape and volume or just the volume were missing from the convergence workflow. These have been added in, corresponding to a VASP ISIF settin of 6 or 7, respectively. Also raising more meaningful exception if an unsupported combination of relaxation options is passed. Test added. * Remove redundant with_dbenvs * Added how to run tests to the documentation * Added file containing the running tests documentation * Introduced retrieve_temporary_list (#288) In order to enable automatic deletion of files after parsing `retrieve_temporary_list` is available in AiiDA. This replaced the `retrieve_list` which do not delete any file after parsing is completed. The current behavior is that all files are delated after parsing unless specific filenames are added using `ADDITIONAL_RETRIEVE_LIST`. * Fixed issue with analysing positional lengths in relaxation workchain (#290) * Fixed issue with analysing positional lengths in relaxation workchain Due to nan entries the `max` function failed and the relaxation workchain did not work as expected. This is now fixed, we keep the nan, but act on the raised `RuntimeWarning` from numpy and set force the convergence to not be complete if this in encountered. An update to the plane wave and k-point convergence workchain is also performed in order to enable a final run using relaxation and the converged plane wave and k-point cutoffs. * Fixed the positional convergence test * Updated parsevasp dependency and fixed semantics in doc (#292) * Updated help text for POTCAR handling (#293) * Updated to account for all VASP output files (#295) * Fixed wrong call to nanmax (#296) * Updated convergence data output to rest in the converge namespace (#298) * Changed ISIF from 1 to 2 (#300) * Fixed problem of relaxation override (#302) * symbols should be stored by set_attribute for TrajectoryData. (#303) * symbols should be stored by set_attribute for TrajectoryData. * Add docstring on _compose_array_trajectory * Disabled D416 to enable numpydoc * Replaced old convergence_data (#309) * Compatibility with AiiDA 1.1.0 (#312) * Compatibility with AiiDA 1.1.0 In this commit we clean up the package dependencies such that we strictly follow AiiDA versioning also on the development and testing part which makes it easier to perform development on both aiida-core and aiida-vasp. In addition, liniting was redone to suite updated versions. Note that we had to disable the immigrator tests since they got stuck forever. Solving this is left as an issue. * Added parallel flag to coverage config * Generalization of workchains (#314) In order to open for the use of the workchains in other codes, we here decouple the workchains and the VASP specific parameters. In the workchains we use AiiDA/workchain specific parameters, which is translated at the code specific workchain in the workchain stack to code specific parameters. This concept can also be utilized by other codes. * Excluded the POTCAR file from the storage in the repository (#315) * Add lambda on input defaults (#316) To comply with the update aiidateam/aiida-core#3466 we here incorporate lambda on all input nodes that are of an AiiDA data type. This is done to make it clear that we want to supply a immutable object as input. This also fixes the problem of not being able to run consequetive workchain tests, so in this PR all of the present workchain tests are finally enabled. In addition this PR fixes the previous problems of not being able to build RTD due to the need of a backend. Please consult aiidateam/aiida-core#3466 and reference therein for additional details. * Make sure always retrieve files are stored by default (#322) * Make sure always retrieve files are stored by default The always retrieve files are now stored as a default. This can be changed by setting ALWAYS_STORE to False in the settings, or as before specify ALWAYS_RETRIEVE_LIST and ALWAYS_RETRIEVE_TEMPORARY_LIST, also in settings. A few tests to tests different combinations have been introduced. * Pinned to AiiDA 1.1 due to issue 323 * Removed print * With the recent aiidateam/aiida-core#3935 #323 is not strictly necessary and we can lift the pinning to AiiDA core 1.1. (#326) Thanks @atztogo. * #320 related stuff and other minor fixes (#321) * Making parser work when no temporary folder The parser can handle the case there is to no temporary retrieve folder. But it would throw an error code. This commit let it throw the error only when both retrieve folders are not present. This also allows parsing exising calcjobs using `VaspParser.parse_from_node`. * Warn if `parser_name` is not defined * Fix a bug where massage does not work with uppercased keys * Fix linter warnings * Let VaspCalculation default to use vasp.vasp parser * VaspWorkChain no longer sets parser_name updated test Co-authored-by: Espen <espen.flage-larsen@sintef.no> * Fixed immigrator by adding explicit call to presubmit (#334) * Fixed immigrator by adding explicit call to presubmit * Updating return values due to pending PR in AiiDA core * Added AiiDA trove classifier (#340) * Fixed migration of the Wannier90 interface (#341) * Update tutorial documents (#344) * fix tab-completion * example for SGE * fix tutorials numbering * remove account name and fix attribute name * Fixed skipped test for band workchain (#343) * Fixed skipped test for band workchain * Moved bands related parameters to the parameter massager * Added additional tests for smearing, charge and bands parameters * Moved override input parameters into a namespace (#348) In order to be able to check any supplied override parameters we needed to move these into a dedicated namespace. This namespace, now also corresponds well to the workchain where the conversion takes place. * Catch invalid INCAR tags (#333) * Catch invalid INCAR tags * Added checking of invalid INCAR for ParametersMassage * Updated tests and removed redundant namespace list Co-authored-by: espenfl <espen.flage-larsen@sintef.no> * Added sphinxcontrib-details-directive to requirements (#350) * Remove coverage combine as we are only building one report (#351) * Updated travis and tox settings (#352) * Enabled GitHub Actions workflow and Codecov (#353) * Added Codecov badge and removed Coveralls (#354) * Added Codecov badge and removed Coveralls * Added codecov config file to enable status check * Enabled the remaining code for coverage analysis (#355) * Enabled the remaining code for coverage analysis * Updated codecov config * Removed fix for repo * Updated the setup json file (#357) * Updated the readme to include more badges (#358) * Added badges into a table (#359) * Update documentation (#361) * Removed warning for included POTCAR and minor fixes in doc * Added note about incomplete doc of workchains * Parsing of the magnetization and magnetization node (#360) * Adding parsing of the magnetization * Adding the site magnetization as its own node in the output * Added tests for the parsing of the magnetization * Fixed too long line * Fixed linting * Changed the magnetization tests so that they use only a single parsing function Co-authored-by: espenfl <espen.flage-larsen@sintef.no> * Preparing for release 1.0.0 Co-authored-by: mcallsen <35340473+mcallsen@users.noreply.github.com> Co-authored-by: Jason.Yu <morty.yu@yahoo.com> Co-authored-by: Atsushi Togo <atz.togo@gmail.com> Co-authored-by: Martin Uhrin <martin.uhrin@gmail.com> Co-authored-by: Bonan Zhu <33688599+zhubonan@users.noreply.github.com> Co-authored-by: Kohei Shinohara <kohei19950508@gmail.com> Co-authored-by: Jonathan Chico <37243453+JPchico@users.noreply.github.com> Co-authored-by: mcallsen <35340473+mcallsen@users.noreply.github.com> Co-authored-by: Jason.Yu <morty.yu@yahoo.com> Co-authored-by: Atsushi Togo <atz.togo@gmail.com> Co-authored-by: Martin Uhrin <martin.uhrin@gmail.com> Co-authored-by: Bonan Zhu <33688599+zhubonan@users.noreply.github.com> Co-authored-by: Kohei Shinohara <kohei19950508@gmail.com> Co-authored-by: Jonathan Chico <37243453+JPchico@users.noreply.github.com>
Fixes #2515 and fixes #3143
Using mutable objects as defaults for
InputPorts
can lead tounexpected result and should be discouraged. We override the
InputPort
constructor to check the type of the default, if specified and emit a
warning if it is not a lambda, i.e. a callable or an immutable type. The
check for immutability is not well-defined in python so we check whether
the default has a type within a set of known immutable types. This means
that there can be obscure immutable types that trigger a false positive
but since all we do is print a
UserWarning
this is acceptable.The
CalcJob
implementation had to be adapted to conform with the newrequirements as the
mpirun_extra_params
andenvironment_variables
metadata options were using mutable types for their default. The
defaults have been changed to the
list
anddict
base types whichwhen not instantiated act like callables and therefore respect the
rules.