diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 61b1b6a..a8def26 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -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/ssh-agent@v0.4.1 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 4b2de92..0aace6a 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -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 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 40631e8..88385fb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -34,7 +34,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: Run tests env: @@ -42,4 +42,4 @@ jobs: GLORIA_INSTANCE_TOKEN: ${{ secrets.GLORIA_INSTANCE_TOKEN }} MELMAN_INSTANCE_TOKEN: ${{ secrets.MELMAN_INSTANCE_TOKEN }} run: | - ./scope/scope.py test + ./scope/scope_class.py test diff --git a/.github/workflows/test_no_kowalski.yml b/.github/workflows/test_no_kowalski.yml index 0bc2d59..ef0acf0 100644 --- a/.github/workflows/test_no_kowalski.yml +++ b/.github/workflows/test_no_kowalski.yml @@ -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 diff --git a/pyproject.toml b/pyproject.toml index 0d3b4ac..6c58700 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" diff --git a/scope/_instantiate.py b/scope/_instantiate.py index aab3928..1464c0d 100644 --- a/scope/_instantiate.py +++ b/scope/_instantiate.py @@ -1,5 +1,5 @@ # For use by pip-installed scope package -from scope.scope import Scope +from scope.scope_class import Scope scope = Scope() diff --git a/scope/scope.py b/scope/scope_class.py similarity index 98% rename from scope/scope.py rename to scope/scope_class.py index 53ca82a..bed0f1a 100755 --- a/scope/scope.py +++ b/scope/scope_class.py @@ -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 @@ -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") @@ -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 ] )