added metadata collection routine and tests
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import pytest
|
||||
import os
|
||||
import numpy as np
|
||||
import cristallina.utils as utils
|
||||
|
||||
from cristallina.utils import ROI, print_run_info, heuristic_extract_pgroup, gauss, find_nearest, xray_transmission
|
||||
|
||||
|
||||
@@ -10,13 +12,21 @@ def test_print(capsys):
|
||||
assert "17259343145" in captured.out
|
||||
assert "scan_parameters" in captured.out
|
||||
|
||||
|
||||
|
||||
def test_collect_metadata():
|
||||
test_pgroup_dir = "tests/data/p20841"
|
||||
df = utils.collect_runs_metadata(test_pgroup_dir)
|
||||
|
||||
assert df.iloc[1]["user_tag"] == "PMS, Magnet at 78K, 400V excitation"
|
||||
assert df.iloc[1]["start_pulseid"] == 17358560870
|
||||
|
||||
def test_ROI():
|
||||
"""API Tests"""
|
||||
r = ROI(left=1, right=2, top=4, bottom=2)
|
||||
|
||||
assert r.width == 1
|
||||
assert r.height == 2
|
||||
assert r.name is not None
|
||||
|
||||
|
||||
def test_extract_pgroup():
|
||||
|
||||
Reference in New Issue
Block a user