diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index e80e275d0..1e9d67fea 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -62,7 +62,7 @@ jobs: cp abipy/data/managers/gh_manager.yml $HOME/.abinit/abipy/manager.yml cp abipy/data/managers/gh_scheduler.yml $HOME/.abinit/abipy/scheduler.yml # FIXME TEMPORARY HACK - #pip install git+https://github.com/gmatteo/pymatgen.git@master + pip install git+https://github.com/gmatteo/pymatgen.git@master -U - name: Build docs with Sphinx run: | diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 779b1d11b..cb151ffe9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -51,7 +51,7 @@ jobs: cp abipy/data/managers/gh_manager.yml $HOME/.abinit/abipy/manager.yml cp abipy/data/managers/gh_scheduler.yml $HOME/.abinit/abipy/scheduler.yml # FIXME TEMPORARY HACK - #pip install git+https://github.com/gmatteo/pymatgen.git@master + pip install git+https://github.com/gmatteo/pymatgen.git@master -U - name: pytest run: | diff --git a/abipy/flowtk/events.py b/abipy/flowtk/events.py index 7b8779b12..444dd10a3 100644 --- a/abipy/flowtk/events.py +++ b/abipy/flowtk/events.py @@ -40,7 +40,7 @@ ] -__yaml = YAML() +_yaml = YAML() def straceback() -> str: @@ -179,14 +179,14 @@ def correct(self, task): return 0 -@yaml_object(__yaml) +@yaml_object(_yaml) class AbinitComment(AbinitEvent): """Base class for Comment events""" yaml_tag = '!COMMENT' color = "blue" -@yaml_object(__yaml) +@yaml_object(_yaml) class AbinitError(AbinitEvent): """Base class for Error events""" yaml_tag = '!ERROR' @@ -200,14 +200,14 @@ class AbinitYamlError(AbinitError): """ -@yaml_object(__yaml) +@yaml_object(_yaml) class AbinitBug(AbinitEvent): """Base class for Bug events""" yaml_tag = '!BUG' color = "red" -@yaml_object(__yaml) +@yaml_object(_yaml) class AbinitWarning(AbinitEvent): """ Base class for Warning events (the most important class). @@ -232,19 +232,19 @@ class AbinitYamlWarning(AbinitCriticalWarning): ############################### -@yaml_object(__yaml) +@yaml_object(_yaml) class ScfConvergenceWarning(AbinitCriticalWarning): """Warning raised when the GS SCF cycle did not converge.""" yaml_tag = '!ScfConvergenceWarning' -@yaml_object(__yaml) +@yaml_object(_yaml) class NscfConvergenceWarning(AbinitCriticalWarning): """Warning raised when the GS NSCF cycle did not converge.""" yaml_tag = '!NscfConvergenceWarning' -@yaml_object(__yaml) +@yaml_object(_yaml) class RelaxConvergenceWarning(AbinitCriticalWarning): """Warning raised when the structural relaxation did not converge.""" yaml_tag = '!RelaxConvergenceWarning' @@ -256,13 +256,13 @@ class RelaxConvergenceWarning(AbinitCriticalWarning): # yaml_tag = u'!PhononConvergenceWarning' -@yaml_object(__yaml) +@yaml_object(_yaml) class QPSConvergenceWarning(AbinitCriticalWarning): """Warning raised when the QPS iteration (GW) did not converge.""" yaml_tag = '!QPSConvergenceWarning' -@yaml_object(__yaml) +@yaml_object(_yaml) class HaydockConvergenceWarning(AbinitCriticalWarning): """Warning raised when the Haydock method (BSE) did not converge.""" yaml_tag = '!HaydockConvergenceWarning' @@ -447,9 +447,9 @@ def parse(self, filename: str, verbose: int = 0) -> EventReport: filename = os.path.abspath(filename) report = EventReport(filename) - w = WildCard("*Error|*Warning|*Comment|*Bug|*ERROR|*WARNING|*COMMENT|*BUG") - import warnings - warnings.simplefilter('ignore', yaml.error.UnsafeLoaderWarning) + #w = WildCard("*Error|*Warning|*Comment|*Bug|*ERROR|*WARNING|*COMMENT|*BUG") + #import warnings + #warnings.simplefilter('ignore', yaml.error.UnsafeLoaderWarning) with YamlTokenizer(filename) as tokens: for doc in tokens: @@ -780,22 +780,22 @@ def handle_task_event(self, task, event): return self.FIXED - def handle_input_event(self, abiinput, outdir, event): + def handle_input_event(self, abi_input, outdir, event): try: - old_abiinput = abiinput.deepcopy() + old_abiinput = abi_input.deepcopy() # Read the last structure dumped by ABINIT before aborting. filepath = outdir.has_abiext("DILATMX_STRUCT.nc") last_structure = Structure.from_file(filepath) - abiinput.set_structure(last_structure) + abi_input.set_structure(last_structure) #FIXME restart from DEN files not always working with interpolation - return Correction(self, self.compare_inputs(abiinput, old_abiinput), event, reset=True) - # return Correction(self, self.compare_inputs(abiinput, old_abiinput), event, event=False) + return Correction(self, self.compare_inputs(abi_input, old_abiinput), event, reset=True) + # return Correction(self, self.compare_inputs(abi_input, old_abiinput), event, event=False) except Exception as exc: logger.warning('Error while trying to apply the handler {}.'.format(str(self)), exc) return None -@yaml_object(__yaml) +@yaml_object(_yaml) class TolSymError(AbinitError): """ Class of errors raised by Abinit when it cannot detect the symmetries of the system. @@ -838,19 +838,19 @@ def handle_task_event(self, task, event): task.log_correction(event, "Increasing tolsym from %s to %s" % (old_tolsym, new_tolsym)) return self.FIXED - def handle_input_event(self, abiinput, outdir, event): + def handle_input_event(self, abi_input, outdir, event): try: - old_abiinput = abiinput.deepcopy() - old_tolsym = abiinput["tolsym"] + old_abiinput = abi_input.deepcopy() + old_tolsym = abi_input["tolsym"] new_tolsym = 1e-6 if old_tolsym is None else old_tolsym * 10 - abiinput.set_vars(tolsym=new_tolsym) - return Correction(self, self.compare_inputs(abiinput, old_abiinput), event, reset=False) + abi_input.set_vars(tolsym=new_tolsym) + return Correction(self, self.compare_inputs(abi_input, old_abiinput), event, reset=False) except Exception as exc: logger.warning('Error while trying to apply the handler {}.'.format(str(self)), exc) return None -@yaml_object(__yaml) +@yaml_object(_yaml) class MemanaError(AbinitError): """ Class of errors raised by the memory analyzer. @@ -872,17 +872,17 @@ def handle_task_event(self, task, event): task.log_correction(event, "Find MemanaError. Setting mem_test to 0 in input file.") return self.FIXED - def handle_input_event(self, abiinput, outdir, event): + def handle_input_event(self, abi_input, outdir, event): try: - old_abiinput = abiinput.deepcopy() - abiinput.set_vars(mem_test=0) - return Correction(self, self.compare_inputs(abiinput, old_abiinput), event, reset=False) + old_abiinput = abi_input.deepcopy() + abi_input.set_vars(mem_test=0) + return Correction(self, self.compare_inputs(abi_input, old_abiinput), event, reset=False) except Exception as exc: logger.warning('Error while trying to apply the handler {}.'.format(str(self)), exc) return None -@yaml_object(__yaml) +@yaml_object(_yaml) class MemoryError(AbinitError): """ This error occurs when a checked allocation fails in Abinit @@ -903,7 +903,7 @@ def handle_task_event(self, task, event): task.manager.increase_resources() return self.FIXED - def handle_input_event(self, abiinput, outdir, event): + def handle_input_event(self, abi_input, outdir, event): """ Shouldn't do anything on the input """