diff --git a/.github/workflows/tom-tests.yml b/.github/workflows/tom-tests.yml index a48f71d3..6d49f26e 100644 --- a/.github/workflows/tom-tests.yml +++ b/.github/workflows/tom-tests.yml @@ -41,6 +41,11 @@ jobs: run: | docker compose exec -it shell /bin/bash -c "PGPASSWORD=fragile pg_restore --data-only -h postgres -U postgres -d tom_desc /tests/elasticc2_alertcycle_complete.psqlc" + - name: Run a test of pandas + working-directory: resspect + run: | + docker compose exec -it resspect /bin/bash -c "python3 -m pytest -k test_pandas" + - name: Run one night of processing working-directory: resspect run: | diff --git a/src/resspect/time_domain_loop.py b/src/resspect/time_domain_loop.py index 92f337a3..659d2ea1 100644 --- a/src/resspect/time_domain_loop.py +++ b/src/resspect/time_domain_loop.py @@ -820,6 +820,9 @@ def time_domain_loop(config, **kwargs): first_loop_data, light_curve_data = _load_first_loop_and_full_data( first_loop_file_path, config ) + print("After _load_first_loop_and_full_data.") + print(f"type(first_loop_data.pool_labels): {type(first_loop_data.pool_labels).__name__}") + print(f"type(light_curve_data.pool_labels): {type(light_curve_data.pool_labels).__name__}") # get keyword for obj identification id_key_name = light_curve_data.identify_keywords() @@ -835,6 +838,9 @@ def time_domain_loop(config, **kwargs): config.initial_training, config.queryable ) + print("After _update_light_curve_data_val_and_test_data.") + print(f"type(light_curve_data.pool_labels): {type(light_curve_data.pool_labels).__name__}") + light_curve_data = _update_queryable_ids( light_curve_data, id_key_name, config.queryable ) diff --git a/tests/resspect/test_sample_utils.py b/tests/resspect/test_sample_utils.py index 1bc4aebb..fb0eaa80 100644 --- a/tests/resspect/test_sample_utils.py +++ b/tests/resspect/test_sample_utils.py @@ -1,6 +1,7 @@ """Tests for sample_utils.py.""" import numpy as np +import pandas as pd import pytest from resspect.samples_utils import sep_samples @@ -47,6 +48,13 @@ def test_sep_samples_too_many(): assert len(samples) == 4 assert len(samples["query"]) == 0 +def test_pandas(): + data = {"a":[1,2,3],"b":[4,5,6]} + assert type(data).__name__ == 'dict' + df = pd.DataFrame(data) + assert type(df).__name__ == 'DataFrame' + assert type(df["a"]).__name__ == 'Series' + assert type(df["a"].values).__name__ == 'ndarray' if __name__ == '__main__': pytest.main()