Skip to content

Commit

Permalink
More stabs in the dark at when the type changes on GHA
Browse files Browse the repository at this point in the history
  • Loading branch information
mtauraso committed Dec 11, 2024
1 parent 58b62b2 commit 072d625
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/tom-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
6 changes: 6 additions & 0 deletions src/resspect/time_domain_loop.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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
)
Expand Down
8 changes: 8 additions & 0 deletions tests/resspect/test_sample_utils.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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()

0 comments on commit 072d625

Please sign in to comment.