awmitch / aiida-dakota

AiiDA plugin for Dakota
MIT License
0 stars 0 forks source link

Investigate restart folder handling #6

Open awmitch opened 3 years ago

awmitch commented 3 years ago

dakota.study entrypoint added successfully using pip install . in aiida-dakota directory while in the aiida instance

code created successfully from dakota executable and with the 'dakota.study' plugin specified

attempting to get builder from code gives the following

In [2]: code = load_code('dakota@laptop')

In [3]: builder = code.get_builder()
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-4-36e9f4b7d575> in <module>
----> 1 builder = code.get_builder()

~/envs/aiida/lib/python3.8/site-packages/aiida/orm/nodes/data/code.py in get_builder(self)
    488 
    489         try:
--> 490             process_class = CalculationFactory(plugin_name)
    491         except exceptions.EntryPointError:
    492             raise exceptions.EntryPointError(f'the calculation entry point `{plugin_name}` could not be loaded')

~/envs/aiida/lib/python3.8/site-packages/aiida/plugins/factories.py in CalculationFactory(entry_point_name)
     58 
     59     entry_point_group = 'aiida.calculations'
---> 60     entry_point = BaseFactory(entry_point_group, entry_point_name)
     61     valid_classes = (CalcJob, calcfunction)
     62 

~/envs/aiida/lib/python3.8/site-packages/aiida/plugins/factories.py in BaseFactory(group, name)
     44     """
     45     from .entry_point import load_entry_point
---> 46     return load_entry_point(group, name)
     47 
     48 

~/envs/aiida/lib/python3.8/site-packages/aiida/plugins/entry_point.py in load_entry_point(group, name)
    207 
    208     try:
--> 209         loaded_entry_point = entry_point.load()
    210     except ImportError:
    211         raise LoadingEntryPointError(f"Failed to load entry point '{name}':\n{traceback.format_exc()}")

~/envs/aiida/lib/python3.8/site-packages/reentry/entrypoint.py in load(self)
     36         import functools
     37         from importlib import import_module
---> 38         module = import_module(self.module_name)
     39         try:
     40             return functools.reduce(getattr, self.attrs, module)

/usr/local/lib/python3.8/importlib/__init__.py in import_module(name, package)
    125                 break
    126             level += 1
--> 127     return _bootstrap._gcd_import(name[level:], package, level)
    128 
    129 

/usr/local/lib/python3.8/importlib/_bootstrap.py in _gcd_import(name, package, level)

/usr/local/lib/python3.8/importlib/_bootstrap.py in _find_and_load(name, import_)

/usr/local/lib/python3.8/importlib/_bootstrap.py in _find_and_load_unlocked(name, import_)

/usr/local/lib/python3.8/importlib/_bootstrap.py in _call_with_frames_removed(f, *args, **kwds)

/usr/local/lib/python3.8/importlib/_bootstrap.py in _gcd_import(name, package, level)

/usr/local/lib/python3.8/importlib/_bootstrap.py in _find_and_load(name, import_)

/usr/local/lib/python3.8/importlib/_bootstrap.py in _find_and_load_unlocked(name, import_)

/usr/local/lib/python3.8/importlib/_bootstrap.py in _load_unlocked(spec)

/usr/local/lib/python3.8/importlib/_bootstrap_external.py in exec_module(self, module)

/usr/local/lib/python3.8/importlib/_bootstrap.py in _call_with_frames_removed(f, *args, **kwds)

~/Dropbox/Professional/Rocstar/OPTImat/aiida-dakota/aiida_dakota/calculations/__init__.py in <module>
     19 from .helpers import DAKOTAInputValidationError
     20 
---> 21 class BaseStudyInputGenerator(CalcJob):
     22     """Base `CalcJob` for implementations for dakota of Dakota."""
     23 

~/Dropbox/Professional/Rocstar/OPTImat/aiida-dakota/aiida_dakota/calculations/__init__.py in BaseStudyInputGenerator()
     70 
     71     # In restarts, it will copy from the parent the following
---> 72     _restart_copy_from = os.path.join(_OUTPUT_SUBFOLDER, '*')
     73 
     74     # In restarts, it will copy the previous folder in the following one

NameError: name '_OUTPUT_SUBFOLDER' is not defined
awmitch commented 3 years ago

commenting out

    # In restarts, it will copy from the parent the following
    #_restart_copy_from = os.path.join(_OUTPUT_SUBFOLDER, '*')

    # In restarts, it will copy the previous folder in the following one
    #_restart_copy_to = _OUTPUT_SUBFOLDER

    ....

        # Create the subfolder for the output data (sometimes Dakota codes crash if the folder does not exist)
        #folder.get_subfolder(self._OUTPUT_SUBFOLDER, create=True)

in /aiida-dakota/aiida_dakota/calculations/__init__.py in BaseStudyInputGenerator() is temporary workaround be further explored