Skip to content

Commit

Permalink
try updating the imports
Browse files Browse the repository at this point in the history
  • Loading branch information
menzel-gfdl committed Dec 23, 2024
1 parent 9ccdb76 commit 5119882
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 21 deletions.
17 changes: 1 addition & 16 deletions catalogbuilder/scripts/gen_intake_gfdl.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,12 @@
import os
from pathlib import Path
import logging
from ..intakebuilder import gfdlcrawler, CSVwriter, builderconfig, configparser, getinfo

logger = logging.getLogger('local')
logger.setLevel(logging.INFO)
logging.basicConfig(stream=sys.stdout)

try:
from catalogbuilder.intakebuilder import gfdlcrawler, CSVwriter, builderconfig, configparser, getinfo
except ModuleNotFoundError:
print("The module intakebuilder is not installed. Do you have intakebuilder in your sys.path or have you activated the conda environment with the intakebuilder package in it? ")
print("Attempting again with adjusted sys.path ")
try:
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
except:
print("Unable to adjust sys.path")
#print(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
try:
from intakebuilder import gfdlcrawler, CSVwriter, builderconfig, configparser,getinfo
print(gfdlcrawler.__file__)
except ModuleNotFoundError:
sys.exit("The module 'intakebuilder' is still not installed. Do you have intakebuilder in your sys.path or have you activated the conda environment with the intakebuilder package in it? ")

package_dir = os.path.dirname(os.path.abspath(__file__))
#template_path = os.path.join(package_dir, '../cats/gfdl_template.json')

Expand Down
2 changes: 1 addition & 1 deletion catalogbuilder/scripts/gen_intake_gfdl_runner.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python

#TODO test after conda pkg is published and make changes as needed
from catalogbuilder.scripts import gen_intake_gfdl
from ..scripts import gen_intake_gfdl
import sys

input_path = "archive/am5/am5/am5f3b1r0/c96L65_am5f3b1r0_pdclim1850F/gfdl.ncrc5-deploy-prod-openmp/pp"
Expand Down
3 changes: 1 addition & 2 deletions catalogbuilder/scripts/gen_intake_gfdl_runner_config.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import catalogbuilder
from catalogbuilder.scripts import gen_intake_gfdl
from ..scripts import gen_intake_gfdl
import sys, os

#This is an example call to run catalog builder using a yaml config file.
Expand Down
3 changes: 1 addition & 2 deletions catalogbuilder/scripts/gen_intake_s3.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/usr/bin/env python3
import os
#from intakebuilder import getinfo, s3crawler, CSVwriter
from . import getinfo, s3crawler, CSVwriter
from ..intakebuilder import s3crawler, CSVwriter
import logging
logger = logging.getLogger('local')
hdlr = logging.FileHandler('/Users/ar46/logs/local.log')
Expand Down

0 comments on commit 5119882

Please sign in to comment.