Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix timeseries import #177

Merged
merged 2 commits into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions cupid/clean.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@

import click

import cupid.util
try:
import util
except ModuleNotFoundError:
import cupid.util as util


def read_config_file(config_path):
Expand All @@ -30,7 +33,7 @@ def read_config_file(config_path):
None
"""
# Obtain the contents of the configuration file and extract the run_dir variable
control = cupid.util.get_control_dict(config_path)
control = util.get_control_dict(config_path)
run_dir = control["data_sources"].get("run_dir", None)

if run_dir:
Expand All @@ -52,7 +55,7 @@ def clean(config_path):
Args: CONFIG_PATH - The path to the configuration file.

"""
logger = cupid.util.setup_logging(config_path)
logger = util.setup_logging(config_path)
run_dir = read_config_file(config_path)
# Delete the "computed_notebooks" folder and all the contents inside of it
shutil.rmtree(run_dir)
Expand Down
15 changes: 9 additions & 6 deletions cupid/run_diagnostics.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@
import intake
import ploomber

import cupid.util
try:
import util
except ModuleNotFoundError:
import cupid.util as util

CONTEXT_SETTINGS = dict(help_option_names=["-h", "--help"])

Expand Down Expand Up @@ -70,9 +73,9 @@ def run_diagnostics(
# fmt: on
# pylint: enable=line-too-long
# Get control structure
control = cupid.util.get_control_dict(config_path)
cupid.util.setup_book(config_path)
logger = cupid.util.setup_logging(config_path)
control = util.get_control_dict(config_path)
util.setup_book(config_path)
logger = util.setup_logging(config_path)

component_options = {
"atm": atmosphere,
Expand Down Expand Up @@ -182,7 +185,7 @@ def run_diagnostics(
# Setting up notebook tasks

for nb, info in all_nbs.items():
cupid.util.create_ploomber_nb_task(
util.create_ploomber_nb_task(
nb,
info,
cat_path,
Expand Down Expand Up @@ -224,7 +227,7 @@ def run_diagnostics(
# Setting up script tasks

for script, info in all_scripts.items():
cupid.util.create_ploomber_script_task(
util.create_ploomber_script_task(
script,
info,
cat_path,
Expand Down
9 changes: 7 additions & 2 deletions cupid/run_timeseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,13 @@
import os

import click
import timeseries
import util

try:
import timeseries
import util
except ModuleNotFoundError:
import cupid.timeseries as timeseries
import cupid.util as util

CONTEXT_SETTINGS = dict(help_option_names=["-h", "--help"])

Expand Down