Commit 38c39009 authored by payno's avatar payno
Browse files

move to h5py 3.1

parent cad37b51
Pipeline #38581 failed with stages
in 5 minutes and 43 seconds
......@@ -84,8 +84,8 @@ class TestReprocessingPyMca(unittest.TestCase):
writer = XASWriter()
writer.output_file = self.h5_file
writer(out)
assert out.spectra[0].ft.intensity is not None
assert len(out.get_process_flow()) is 5
self.assertTrue(out.spectra[0].ft.intensity is not None)
self.assertEqual(len(out.get_process_flow()), 5)
def tearDown(self):
shutil.rmtree(self.output_dir)
......
......@@ -36,6 +36,7 @@ import tempfile
import unittest
import h5py
import numpy
from silx.io.utils import h5py_read_dataset
from silx.io.dictdump import h5todict
from silx.io.url import DataUrl
from est.core.process.roi import xas_roi, _ROI as XASROI
......@@ -178,9 +179,13 @@ class TestWorkflowAndH5LinkedFile(unittest.TestCase):
# then check all process are correctly registered with the valid id...
processes = self.xas_obj.get_process_flow()
self.assertEqual(len(processes), 5)
self.assertEqual(processes[1]["program"], "pymca_normalization")
self.assertEqual(processes[2]["program"], "pymca_exafs")
self.assertEqual(processes[5]["program"], "pymca_normalization")
self.assertEqual(
h5py_read_dataset(processes[1]["program"]), "pymca_normalization"
)
self.assertEqual(h5py_read_dataset(processes[2]["program"]), "pymca_exafs")
self.assertEqual(
h5py_read_dataset(processes[5]["program"]), "pymca_normalization"
)
self.xas_obj.clean_process_flow()
processes = self.xas_obj.get_process_flow()
self.assertEqual(len(processes), 0)
......@@ -209,9 +214,13 @@ class TestWorkflowAndH5LinkedFile(unittest.TestCase):
# then check all process are correctly registered with the valid id...
processes = self.xas_obj.get_process_flow()
self.assertEqual(len(processes), 5)
self.assertEqual(processes[1]["program"], "pymca_normalization")
self.assertEqual(processes[2]["program"], "pymca_exafs")
self.assertEqual(processes[5]["program"], "pymca_normalization")
self.assertEqual(
h5py_read_dataset(processes[1]["program"]), "pymca_normalization"
)
self.assertEqual(h5py_read_dataset(processes[2]["program"]), "pymca_exafs")
self.assertEqual(
h5py_read_dataset(processes[5]["program"]), "pymca_normalization"
)
self.xas_obj.clean_process_flow()
processes = self.xas_obj.get_process_flow()
self.assertEqual(len(processes), 0)
......@@ -268,8 +277,9 @@ class TestSaveFlowAuto(unittest.TestCase):
self.assertTrue("xas_process_5" in hdf["scan1"].keys())
targetted_xas_process = hdf["scan1"]["xas_process_2"]
self.assertTrue("program" in targetted_xas_process)
print(targetted_xas_process["program"][()])
self.assertTrue(targetted_xas_process["program"][()] == "pymca_exafs")
self.assertEqual(
h5py_read_dataset(targetted_xas_process["program"]), "pymca_exafs"
)
self.assertTrue("configuration" in targetted_xas_process)
# check one configuration
......
......@@ -31,6 +31,7 @@ __date__ = "07/18/2019"
import importlib
import logging
from silx.io.utils import h5py_read_dataset
_logger = logging.getLogger(__name__)
......@@ -43,7 +44,7 @@ def get_process_instance_frm_h5_desc(desc):
"""
assert "program" in desc
assert "class_instance" in desc
tmp = str(desc["class_instance"]).split(".")
tmp = h5py_read_dataset(desc["class_instance"]).split(".")
module_name = ".".join(tmp[:-1])
class_name = tmp[-1]
try:
......
......@@ -38,6 +38,7 @@ import tempfile
import os
import shutil
from silx.utils.enum import Enum
from silx.io.utils import h5py_read_dataset
_logger = logging.getLogger(__name__)
......@@ -648,7 +649,8 @@ class XASObject(object):
for process_ in process_list:
if (
"program" in process_.keys()
and process_["program"] in know_process # noqa
and h5py_read_dataset(process_["program"])
in know_process # noqa
):
res.append(process_)
return res
......
silx>=0.12
silx>=0.14b
pypushflow>=0.2.0b
h5py>=3.1
\ No newline at end of file
......@@ -480,10 +480,11 @@ def get_project_configuration(dry_run):
"numpy",
# for the script launcher
"setuptools",
"h5py>=3.1",
]
full_requires = [
"silx>=0.12",
"silx>=0.14b",
"pypushflow>=0.2b.0",
"PyMca",
"xraylarch",
......
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