Open sphuber opened 1 year ago
Note that we're currently using the ComputerBuilder
from this module in AiiDAlab.
cc @unkcpz @yakutovicha
Note that the entire functionality you are using can be easily recreated using base resources:
from aiida.common.exceptions import ValidationError
from aiida.orm import Computer
computer = Computer(
label='label',
description='description',
hostname='hostname',
transport_type='transport',
scheduler_type='scheduler',
workdir='workdir',
)
properties = {
'shebang': 'value',
'mpirun_command': 'value',
'default_memory_per_machine': 'value',
'default_mpiprocs_per_machine': 'value',
'use_double_quotes': 'value',
'prepend_text': 'value',
'append_text': 'value',
}
for key, value in properties.items():
computer.set_property(key, value)
try:
computer.store()
except ValidationError:
# Handle it
I would argue that the amount of code that is in the ComputerBuilder
does not justify its maintenance cost given there is straightforward implementation available.
I agree that the set_property
interface being separate is not ideal, but that is historical.
Its functionality is not clear. It is just used in the
verdi computer setup
command and is essentially used for some validation, but this is already done in theaiida.orm.Computer
class, so it feels like this is a very verbose layer that doesn't add much.