Commit fdd2c651 authored by Henri Payno's avatar Henri Payno
Browse files

turn off test on registered processes since they are no more registered

parent ef2f6f8a
Pipeline #80711 passed with stages
in 8 minutes and 9 seconds
......@@ -5,8 +5,9 @@ unit test for workflow composed of pymca process
import pytest
import h5py
import numpy
from silx.io.utils import h5py_read_dataset
from silx.io.dictdump import h5todict
# from silx.io.utils import h5py_read_dataset
# from silx.io.dictdump import h5todict
from est.core.process.roi import xas_roi, _ROI as XASROI
from est.core.io import XASWriter
from est.core.io import read as read_xas
......@@ -152,10 +153,10 @@ def test_h5_link_xas_object(tmpdir):
# then check all process are correctly registered with the valid id...
processes = xas_obj.get_process_flow()
assert len(processes) == 5
assert h5py_read_dataset(processes[1]["program"]) == "pymca_normalization"
assert h5py_read_dataset(processes[2]["program"]) == "pymca_exafs"
assert h5py_read_dataset(processes[5]["program"]) == "pymca_normalization"
# assert len(processes) == 5
# assert h5py_read_dataset(processes[1]["program"]) == "pymca_normalization"
# assert h5py_read_dataset(processes[2]["program"]) == "pymca_exafs"
# assert h5py_read_dataset(processes[5]["program"]) == "pymca_normalization"
xas_obj.clean_process_flow()
processes = xas_obj.get_process_flow()
......@@ -191,10 +192,10 @@ def test_h5_link_dict(tmpdir):
# then check all process are correctly registered with the valid id...
processes = xas_obj.get_process_flow()
assert len(processes) == 5
assert h5py_read_dataset(processes[1]["program"]) == "pymca_normalization"
assert h5py_read_dataset(processes[2]["program"]) == "pymca_exafs"
assert h5py_read_dataset(processes[5]["program"]) == "pymca_normalization"
# assert len(processes) == 5
# assert h5py_read_dataset(processes[1]["program"]) == "pymca_normalization"
# assert h5py_read_dataset(processes[2]["program"]) == "pymca_exafs"
# assert h5py_read_dataset(processes[5]["program"]) == "pymca_normalization"
xas_obj.clean_process_flow()
processes = xas_obj.get_process_flow()
......@@ -234,20 +235,20 @@ def test_save_flow_auto(tmpdir):
assert "data" in hdf["scan1"].keys()
assert "absorbed_beam" in hdf["scan1"].keys()
assert "monochromator" in hdf["scan1"].keys()
assert "xas_process_1" in hdf["scan1"].keys()
assert "xas_process_2" in hdf["scan1"].keys()
assert "xas_process_3" in hdf["scan1"].keys()
assert "xas_process_4" in hdf["scan1"].keys()
assert "xas_process_5" in hdf["scan1"].keys()
targetted_xas_process = hdf["scan1"]["xas_process_2"]
assert "program" in targetted_xas_process
assert h5py_read_dataset(targetted_xas_process["program"]) == "pymca_exafs"
# assert "xas_process_1" in hdf["scan1"].keys()
# assert "xas_process_2" in hdf["scan1"].keys()
# assert "xas_process_3" in hdf["scan1"].keys()
# assert "xas_process_4" in hdf["scan1"].keys()
# assert "xas_process_5" in hdf["scan1"].keys()
# targetted_xas_process = hdf["scan1"]["xas_process_2"]
# assert "program" in targetted_xas_process
# assert h5py_read_dataset(targetted_xas_process["program"]) == "pymca_exafs"
assert "configuration" in targetted_xas_process
# assert "configuration" in targetted_xas_process
# check one configuration
stored_config = h5todict(
h5_file, path="/scan1/xas_process_2/configuration", asarray=False
)
for key in ("KMin", "KMax"):
assert configuration[key] == stored_config[key]
# stored_config = h5todict(
# h5_file, path="/scan1/xas_process_2/configuration", asarray=False
# )
# for key in ("KMin", "KMax"):
# assert configuration[key] == stored_config[key]
import pytest
from est.core.types import XASObject
from silx.io.utils import h5py_read_dataset
import h5py
# from silx.io.utils import h5py_read_dataset
# import h5py
try:
import larch
......@@ -16,7 +17,6 @@ def test_write(spectrum_cu_from_larch, tmpdir):
xas_obj = XASObject(
spectra=(spectrum_cu_from_larch,), energy=spectrum_cu_from_larch.energy
)
output_file = tmpdir / "output.h5"
assert spectrum_cu_from_larch.pre_edge is None
assert spectrum_cu_from_larch.e0 is None
......@@ -26,21 +26,22 @@ def test_write(spectrum_cu_from_larch, tmpdir):
assert spectrum_cu_from_larch.e0 is not None
# check process
xas_obj.dump(str(output_file))
assert output_file.exists()
with h5py.File(str(output_file), "r") as h5f:
scan = h5f["scan1"]
pre_edge_process = scan["xas_process_1"]
# check general informqtion
assert "class_instance" in pre_edge_process
assert "date" in pre_edge_process
assert "processing_order" in pre_edge_process
assert "program" in pre_edge_process
assert "version" in pre_edge_process
assert h5py_read_dataset(pre_edge_process["program"]) == "larch_pre_edge"
# output_file = tmpdir / "output.h5"
# xas_obj.dump(str(output_file))
# assert output_file.exists()
# with h5py.File(str(output_file), "r") as h5f:
# scan = h5f["scan1"]
# pre_edge_process = scan["xas_process_1"]
# # check general informqtion
# assert "class_instance" in pre_edge_process
# assert "date" in pre_edge_process
# assert "processing_order" in pre_edge_process
# assert "program" in pre_edge_process
# assert "version" in pre_edge_process
# assert h5py_read_dataset(pre_edge_process["program"]) == "larch_pre_edge"
# check results
assert "results" in pre_edge_process
results_grp = pre_edge_process["results"]
assert "mu" in results_grp
assert "normalized_mu" in results_grp
# # check results
# assert "results" in pre_edge_process
# results_grp = pre_edge_process["results"]
# assert "mu" in results_grp
# assert "normalized_mu" in results_grp
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment