Skip to content

Commit

Permalink
Merge pull request #177 from mnlevy1981/fix_timeseries_import
Browse files Browse the repository at this point in the history
Fix timeseries import
  • Loading branch information
mnlevy1981 authored Jan 31, 2025
2 parents f4fe116 + 5dde643 commit 7d87a00
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 11 deletions.
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

0 comments on commit 7d87a00

Please sign in to comment.