Skip to content

Commit

Permalink
Rename scope.py to scope_class.py, update other code
Browse files Browse the repository at this point in the history
  • Loading branch information
bfhealy committed Dec 12, 2023
1 parent 7bf50c5 commit 079285f
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 23 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,17 @@ jobs:
pip install wheel latex
pip install -r requirements.txt
cp config.defaults.yaml config.yaml
./scope/scope.py develop
./scope/scope_class.py develop
- name: Lint sources
run: |
./scope/scope.py lint
./scope/scope_class.py lint
- name: Build docs
env:
KOWALSKI_INSTANCE_TOKEN: ${{ secrets.KOWALSKI_INSTANCE_TOKEN }}
GLORIA_INSTANCE_TOKEN: ${{ secrets.GLORIA_INSTANCE_TOKEN }}
MELMAN_INSTANCE_TOKEN: ${{ secrets.MELMAN_INSTANCE_TOKEN }}
run: |
./scope/scope.py doc
./scope/scope_class.py doc
- name: Install SSH Client 🔑
if: github.event_name == 'push' && github.repository_owner == 'ZwickyTransientFacility'
uses: webfactory/[email protected]
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
pip install wheel
pip install -r requirements.txt
cp config.defaults.yaml config.yaml
./scope/scope.py develop
./scope/scope_class.py develop
- name: Lint sources
run: |
./scope/scope.py lint
./scope/scope_class.py lint
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ jobs:
pip install wheel
pip install -r requirements.txt
cp config.defaults.yaml config.yaml
./scope/scope.py develop
./scope/scope_class.py develop
- name: Run tests
env:
KOWALSKI_INSTANCE_TOKEN: ${{ secrets.KOWALSKI_INSTANCE_TOKEN }}
GLORIA_INSTANCE_TOKEN: ${{ secrets.GLORIA_INSTANCE_TOKEN }}
MELMAN_INSTANCE_TOKEN: ${{ secrets.MELMAN_INSTANCE_TOKEN }}
run: |
./scope/scope.py test
./scope/scope_class.py test
4 changes: 2 additions & 2 deletions .github/workflows/test_no_kowalski.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
pip install wheel
pip install -r requirements.txt
cp config.defaults.yaml config.yaml
./scope/scope.py develop
./scope/scope_class.py develop
- name: Test without kowalski connection
run: |
./scope/scope.py test_limited
./scope/scope_class.py test_limited
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ pre-commit = ">=3.5.0"

[tool.poetry.scripts]
scope-develop = "scope._instantiate:develop"
scope-lint = "scope.scope:Scope.lint"
scope-lint = "scope.scope_class:Scope.lint"
scope-doc = "scope._instantiate:doc"
scope-train = "scope._instantiate:train"
create-training-script = "scope._instantiate:create_training_script"
Expand Down
2 changes: 1 addition & 1 deletion scope/_instantiate.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# For use by pip-installed scope package
from scope.scope import Scope
from scope.scope_class import Scope

scope = Scope()

Expand Down
20 changes: 8 additions & 12 deletions scope/scope.py → scope/scope_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,14 @@
import tdtax
from typing import Optional, Sequence, Union
import yaml

# from scope.utils import (
from .utils import (
from scope.utils import (
forgiving_true,
load_config,
read_hdf,
read_parquet,
write_parquet,
)

# from scope.fritz import radec_to_iau_name
from .fritz import radec_to_iau_name
from scope.fritz import radec_to_iau_name
import json
import shutil
import argparse
Expand Down Expand Up @@ -1609,12 +1605,12 @@ def create_training_script(
).name

script.writelines(
f"./scope.py train --tag={tag} --algorithm={algorithm} --path_dataset={path_dataset} --pre_trained_model=models/{pre_trained_group_name}/{tag}/{most_recent_file} --period_suffix={period_suffix} --verbose {add_keywords} \n"
f"scope-train --tag={tag} --algorithm={algorithm} --path_dataset={path_dataset} --pre_trained_model=models/{pre_trained_group_name}/{tag}/{most_recent_file} --period_suffix={period_suffix} --verbose {add_keywords} \n"
)

elif train_all:
script.writelines(
f"./scope.py train --tag={tag} --algorithm={algorithm} --path_dataset={path_dataset} --period_suffix={period_suffix} --verbose {add_keywords} \n"
f"scope-train --tag={tag} --algorithm={algorithm} --path_dataset={path_dataset} --period_suffix={period_suffix} --verbose {add_keywords} \n"
)

script.write("# Ontological\n")
Expand All @@ -1626,26 +1622,26 @@ def create_training_script(
).name

script.writelines(
f"./scope.py train --tag={tag} --algorithm={algorithm} --path_dataset={path_dataset} --pre_trained_model=models/{pre_trained_group_name}/{tag}/{most_recent_file} --period_suffix={period_suffix} --verbose {add_keywords} \n"
f"scope-train --tag={tag} --algorithm={algorithm} --path_dataset={path_dataset} --pre_trained_model=models/{pre_trained_group_name}/{tag}/{most_recent_file} --period_suffix={period_suffix} --verbose {add_keywords} \n"
)

elif train_all:
script.writelines(
f"./scope.py train --tag={tag} --algorithm={algorithm} --path_dataset={path_dataset} --period_suffix={period_suffix} --verbose {add_keywords} \n"
f"scope-train --tag={tag} --algorithm={algorithm} --path_dataset={path_dataset} --period_suffix={period_suffix} --verbose {add_keywords} \n"
)

else:
script.write("# Phenomenological\n")
script.writelines(
[
f"./scope.py train --tag={tag} --algorithm={algorithm} --path_dataset={path_dataset} --period_suffix={period_suffix} --verbose {add_keywords} \n"
f"scope-train --tag={tag} --algorithm={algorithm} --path_dataset={path_dataset} --period_suffix={period_suffix} --verbose {add_keywords} \n"
for tag in phenom_tags
]
)
script.write("# Ontological\n")
script.writelines(
[
f"./scope.py train --tag={tag} --algorithm={algorithm} --path_dataset={path_dataset} --period_suffix={period_suffix} --verbose {add_keywords} \n"
f"scope-train --tag={tag} --algorithm={algorithm} --path_dataset={path_dataset} --period_suffix={period_suffix} --verbose {add_keywords} \n"
for tag in ontol_tags
]
)
Expand Down

0 comments on commit 079285f

Please sign in to comment.