Rerun jupyternotebooks to check their functionality after relocating them to notebooks. OpenBis related python scripts still need to be tested.

This commit is contained in:
2024-11-24 10:45:40 +01:00
parent 02ded9c11a
commit c257ab6072
6 changed files with 7402 additions and 85 deletions

View File

@ -1,12 +1,22 @@
import os, sys
sys.path.append(os.path.abspath('src'))
import src.openbis_lib as openbis_lib
import src.hdf5_lib as hdf5_lib
import datetime
import os
from nbutils import add_project_path_to_sys_path
# Add project root to sys.path
add_project_path_to_sys_path()
import datetime
import logging
try:
import src.openbis_lib as openbis_lib
import src.hdf5_ops as hdf5_ops
#import pipelines.metadata_revision as metadata_revision
print("Imports successful!")
except ImportError as e:
print(f"Import error: {e}")
def main():
#df_h5 = hdf5_lib.read_hdf5_as_dataframe_v2('BeamTimeMetaData.h5')
@ -23,7 +33,7 @@ def main():
print(sample.identifier)
df_openbis = samples.df.copy(deep=True)
h5_file_path = os.path.join(os.path.curdir,'input_files\\BeamTimeMetaData.h5')
df_h5 = hdf5_lib.read_mtable_as_dataframe(h5_file_path)
df_h5 = hdf5_ops.read_mtable_as_dataframe(h5_file_path)
# dataframe preprocessing steps
df_h5, df_openbis = openbis_lib.align_datetime_observation_windows(df_h5, df_openbis)