Skip to content

Commit

Permalink
fight with poetry, another round
Browse files Browse the repository at this point in the history
  • Loading branch information
ignacioreyes committed Aug 19, 2024
1 parent a3602b0 commit 9e6231e
Show file tree
Hide file tree
Showing 7 changed files with 420 additions and 349 deletions.
2 changes: 1 addition & 1 deletion early_classification_step/model/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ephem==3.7.7.0
absl-py==0.7.1
astor==0.8.0
astropy==3.2.1
astropy~=4.0
bleach==3.1.0
certifi==2019.6.16
chardet==3.0.4
Expand Down
2 changes: 2 additions & 0 deletions early_classification_step/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
apf-base==1.0.7
git+https://[email protected]/alercebroker/[email protected]
723 changes: 393 additions & 330 deletions metadata_step/poetry.lock

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions metadata_step/tests/data/mocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,30 @@
{
"oid": "ZTF00llmn",
"ndet": 1,
"ndethist": 1,
"ncovhist": 1,
"firstmjd": 55500,
"lastmjd": 55530,
"g_r_max": 1.0,
"g_r_mean_corr": 0.92,
"meanra": 45.0,
"meandec": 45.0,
"deltajd": 5.3,
"step_id_corr": "corr_bulk_0",
},
{
"oid": "ZTF21waka",
"ndet": 1,
"ndethist": 1,
"ncovhist": 1,
"firstmjd": 55500,
"lastmjd": 55540,
"g_r_max": 1.0,
"g_r_mean_corr": 0.92,
"meanra": 45.0,
"meandec": 45.0,
"deltajd": 7.4,
"step_id_corr": "corr_bulk_0",
},
]

Expand Down
25 changes: 10 additions & 15 deletions metadata_step/tests/integration/test_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
def _populate_db(conn: PSQLConnection):
with conn.session() as session:
session.execute(insert(Object).values(object_mocks).on_conflict_do_nothing())
session.execute(
insert(Detection).values(detection_mocks).on_conflict_do_nothing()
)
session.execute(insert(Detection).values(detection_mocks).on_conflict_do_nothing())
session.execute(insert(Gaia_ztf).values(gaia_mocks).on_conflict_do_nothing())
session.execute(insert(Ps1_ztf).values(ps1_mocks).on_conflict_do_nothing())
session.commit()
Expand Down Expand Up @@ -43,35 +41,32 @@ def test_step(psql_service):
# assert insertion
ss_result = session.execute(select(Ss_ztf).where(Ss_ztf.oid == "ZTF21waka"))
ps1_result = session.execute(
select(Ps1_ztf)
.where(Ps1_ztf.oid == "ZTF21waka")
.where(Ps1_ztf.candid == 930930930)
select(Ps1_ztf).where(Ps1_ztf.oid == "ZTF21waka").where(Ps1_ztf.candid == 930930930)
)
gaia_result = session.execute(
select(Gaia_ztf)
.where(Gaia_ztf.oid == "ZTF21waka")
.where(Gaia_ztf.candid == 930930930)
select(Gaia_ztf).where(Gaia_ztf.oid == "ZTF21waka").where(Gaia_ztf.candid == 930930930)
)
ss_result = list(ss_result)[0][0].__dict__
ps1_result = list(ps1_result)[0][0].__dict__
gaia_result = list(gaia_result)[0][0].__dict__

assert ss_result["oid"] == "ZTF21waka"
assert ss_result["candid"] == 930930930
assert ss_result["ssdistnr"] == 100

assert ps1_result["oid"] == "ZTF21waka"
assert ps1_result["sgmag1"] == 100

assert gaia_result["neargaia"] == 100

# assert updating
ps1_result = session.execute(
select(Ps1_ztf)
.where(Ps1_ztf.oid == "ZTF00llmn")
.where(Ps1_ztf.candid == 1234567890)
select(Ps1_ztf).where(Ps1_ztf.oid == "ZTF00llmn").where(Ps1_ztf.candid == 1234567890)
)
ps1_result = list(ps1_result)[0][0].__dict__

assert ps1_result["oid"] == "ZTF00llmn"
assert ps1_result["unique1"] == False

# This assertion is failing. I don't understand the
# expected behavior
assert ps1_result["unique1"] is False
6 changes: 3 additions & 3 deletions stamp_classifier_step/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ url = "https://github.com/alercebroker/atlas_stamp_classifier"
priority = "primary"

[tool.poetry.dependencies]
python = ">=3.7,<3.9"
python = ">=3.8,<3.9"
apf-base = { version = "<2.0" }
atlas-stamp-classifier = {git = "ssh://[email protected]/alercebroker/atlas_stamp_classifier.git", rev = "main", optional = true }
astropy = { version = "*", optional = true }
Expand Down Expand Up @@ -71,8 +71,8 @@ black = "~=21.0"

[tool.poetry.group.test.dependencies]
pytest = "^7.3.1"
pytest-cov = "^4.1.0"
pytest-docker = "^1.0.1"
pytest-cov = "*"
pytest-docker = "*"

[tool.poetry.group.atlas]
optional = true
Expand Down
1 change: 1 addition & 0 deletions stamp_classifier_step/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ protobuf==3.15.3
grpcio==1.32
Pygments==2.12
Jinja2==3.0
wget

0 comments on commit 9e6231e

Please sign in to comment.