From 5d9a8a4498f93fb3208e18e5c642b25d19aa6c99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Boulogne?= Date: Tue, 19 Nov 2024 07:50:51 +0100 Subject: [PATCH] add load metadata --- labsw/__init__.py | 2 +- labsw/io.py | 11 +++++++++++ requirements.txt | 1 + 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/labsw/__init__.py b/labsw/__init__.py index 7525d19..66a87bb 100644 --- a/labsw/__init__.py +++ b/labsw/__init__.py @@ -1 +1 @@ -__version__ = '0.1.4' +__version__ = '0.1.5' diff --git a/labsw/io.py b/labsw/io.py index 7585d03..0efafae 100644 --- a/labsw/io.py +++ b/labsw/io.py @@ -1,5 +1,7 @@ import pandas as pd import numpy as np +import yaml + def load_data_RH_logger(filepath, every=1): """ @@ -21,3 +23,12 @@ def load_data_RH_logger(filepath, every=1): df = df.reset_index() del df['index'] return df.iloc[::every] + + +def load_metadata(filepath): + """ + + """ + with open(tilepath, 'r') as stream: + metadata = yaml.safe_load(stream) + return metadata diff --git a/requirements.txt b/requirements.txt index 5da331c..67f3df7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,3 @@ numpy pandas +pyyaml