Skip to content

Commit

Permalink
Cherry-pick from Trackpy branch
Browse files Browse the repository at this point in the history
  • Loading branch information
blakeNaccarato committed Oct 2, 2024
1 parent 16dc7c8 commit 19e06ff
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 59 deletions.
40 changes: 15 additions & 25 deletions packages/pipeline/boilercv_pipeline/cli/experiments.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
"""Run DVC experiments."""

from pathlib import Path
from shlex import split
from subprocess import run

from cappa import invoke
from cappa.base import command
from dev.tools.environment import run
from dvclive import Live
from dev.tools import environment
from pydantic import BaseModel
from yaml import safe_dump, safe_load

Expand All @@ -16,42 +17,31 @@ class Trackpy(BaseModel):

def __call__(self):
"""Run TrackPy object finding experiment."""
dvc_yaml = Path("dvc.yaml")
dvc_yaml.write_text(
encoding="utf-8",
data=safe_dump(
sort_keys=False,
indent=2,
width=float("inf"),
data={
"stages": {
stage: value
for stage, value in safe_load(
dvc_yaml.read_text(encoding="utf-8")
)["stages"].items()
if stage == "find_objects"
}
},
),
)
run(args=split("git checkout trackpy"), check=False)
params_yaml = Path("params.yaml")
params_yaml.write_text(
encoding="utf-8",
data=safe_dump(
sort_keys=False,
indent=2,
sort_keys=False,
width=float("inf"),
data={
**safe_load(params_yaml.read_text(encoding="utf-8")),
"compare_with_trackpy": "--compare-with-trackpy",
"frame_count": 500,
"only_sample": "--only-sample",
},
),
)
run("pre-commit run --all-files prettier", check=False)
with Live(".", resume=True):
pass
environment.run("pre-commit run --all-files prettier", check=False)
for cmd in ["git add .", "git commit -m 'prepare for trackpy experiment'"]:
run(args=split(cmd), check=False)
environment.run("dvc repro find_objects", check=False)
for cmd in [
"git add .",
"git commit -m 'repro trackpy experiment'",
"git push",
]:
run(args=split(cmd), check=False)


if __name__ == "__main__":
Expand Down
1 change: 0 additions & 1 deletion packages/pipeline/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ dependencies = [
"colorcet>=3.0.1",
"copykitten>=1.1.1",
"cyclopts>=2.6.1",
"dvclive>=3.48.0",
"imageio[pyav]>=2.34.1",
"ipykernel>=6.29.4",
"loguru>=0.7.0",
Expand Down
2 changes: 0 additions & 2 deletions requirements/requirements_dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ dvc-objects==5.1.0
dvc-render==1.0.2
dvc-studio-client==0.21.0
dvc-task==0.4.0
dvclive==3.48.0
entrypoints==0.4
execnet==2.1.1
executing==2.1.0
Expand Down Expand Up @@ -237,7 +236,6 @@ pydot==3.0.1
pygit2==1.15.1
pygments==2.18.0
pygtrie==2.5.0
pynvml==11.5.3
pyparsing==3.0.9
pyproj==3.6.1
pyqtgraph==0.13.3
Expand Down
31 changes: 0 additions & 31 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 19e06ff

Please sign in to comment.