Skip to content
Snippets Groups Projects
Commit cdf085ae authored by Alán Muñoz's avatar Alán Muñoz
Browse files

bugfix and add reporter

parent d236804b
No related branches found
No related tags found
No related merge requests found
...@@ -120,7 +120,7 @@ class MetaData: ...@@ -120,7 +120,7 @@ class MetaData:
) )
def add_fields(self, fields_values: dict): def add_fields(self, fields_values: dict):
for field, value in field_values.items(): for field, value in fields_values.items():
self.add_field(field, value) self.add_field(field, value)
......
...@@ -29,6 +29,7 @@ from agora.io.signal import Signal ...@@ -29,6 +29,7 @@ from agora.io.signal import Signal
from extraction.core.extractor import Extractor, ExtractorParameters from extraction.core.extractor import Extractor, ExtractorParameters
from extraction.core.functions.defaults import exparams_from_meta from extraction.core.functions.defaults import exparams_from_meta
from postprocessor.core.processor import PostProcessor, PostProcessorParameters from postprocessor.core.processor import PostProcessor, PostProcessorParameters
from postprocessor.compiler import ExperimentCompiler, PageOrganiser
logging.basicConfig( logging.basicConfig(
filename="aliby.log", filename="aliby.log",
...@@ -82,7 +83,7 @@ class PipelineParameters(ParametersABC): ...@@ -82,7 +83,7 @@ class PipelineParameters(ParametersABC):
id=expt_id, id=expt_id,
distributed=0, distributed=0,
tps=tps, tps=tps,
directory=directory, directory=str(directory),
strain="", strain="",
earlystop=dict( earlystop=dict(
min_tp=180, min_tp=180,
...@@ -130,6 +131,13 @@ class Pipeline(ProcessABC): ...@@ -130,6 +131,13 @@ class Pipeline(ProcessABC):
# for other processes # for other processes
return cls(parameters=PipelineParameters.from_yaml(fpath)) return cls(parameters=PipelineParameters.from_yaml(fpath))
@classmethod
def from_existing_h5(cls, fpath):
with h5py.File(fpath, "r") as f:
pipeline_parameters = PipelineParameters.from_yaml(f.attrs["parameters"])
return cls(pipeline_parameters)
def run(self): def run(self):
# Config holds the general information, use in main # Config holds the general information, use in main
# Steps holds the description of tasks with their parameters # Steps holds the description of tasks with their parameters
...@@ -302,6 +310,7 @@ class Pipeline(ProcessABC): ...@@ -302,6 +310,7 @@ class Pipeline(ProcessABC):
self.parameters.postprocessing self.parameters.postprocessing
).to_dict() ).to_dict()
PostProcessor(filename, post_proc_params).run() PostProcessor(filename, post_proc_params).run()
return True return True
except Exception as e: # bug in the trap getting except Exception as e: # bug in the trap getting
logging.exception( logging.exception(
...@@ -317,6 +326,15 @@ class Pipeline(ProcessABC): ...@@ -317,6 +326,15 @@ class Pipeline(ProcessABC):
if session: if session:
session.close() session.close()
try:
compiler = ExperimentCompiler(None, filepath)
tmp = compiler.run()
po = PageOrganiser(tmp, grid_spec=(3, 2))
po.plot()
po.save(fullpath / f"{directory}report.pdf")
except Exception as e:
print(e)
def check_earlystop(self, filename, es_parameters): def check_earlystop(self, filename, es_parameters):
s = Signal(filename) s = Signal(filename)
df = s["/extraction/general/None/area"] df = s["/extraction/general/None/area"]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment