Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create test for algos #22

Merged
merged 2 commits into from
Apr 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 23 additions & 8 deletions tests/lephare/test_algos.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,27 @@
from rail.estimation.algos.lephare import LephareEstimator
import numpy as np
from rail.estimation.algos.lephare import LephareInformer

def test_basic_estimator_stage_creation():

lephare_dict = {}

estimation_stage = LephareEstimator.make_stage(
name="lephare_estimation",
**lephare_dict
def test_basic_informer_stage_creation():
inform_lephare = LephareInformer.make_stage(
name="inform_Lephare",
nondetect_val=np.nan,
model="lephare.pkl",
hdf5_groupname="",
)

assert estimation_stage.name == 'LephareEstimator'
assert inform_lephare.name == "LephareInformer"

# We need to add some testing data. From the main RAIL repo?
# inform_lephare.inform(train_data)

# def test_basic_estimator_stage_creation():
# estimate_lephare = LephareEstimator.make_stage(
# name="test_Lephare",
# nondetect_val=np.nan,
# model=inform_lephare.get_handle("model"),
# hdf5_groupname="",
# aliases=dict(input="test_data", output="lephare_estim"),
# )

# assert estimate_lephare.name == "LephareEstimator"
Loading