diff --git a/.gitignore b/.gitignore index 3132557fe7f9a133d20301f968e37e415800acd0..a0af6702fdb91589e4cbea24f208be0a98b617d4 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,8 @@ ENV/ env.bak/ venv.bak/ .vscode +.tmp + +#packaging +build/ +src/cso.egg-info/* \ No newline at end of file diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000000000000000000000000000000000000..1e75fd8db3f36dfeb41a3c770e38dbe7e5351ddf --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,6 @@ +repos: +- repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.5.5 + hooks: + - id: ruff-format + - id: ruff # linter \ No newline at end of file diff --git a/README.md b/README.md index ef6dcfce84d9a5c43f3e4e87e21c9b19cffa0e8c..0b75cba541c8f49a6b49dac3b19072ff78761ba8 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,32 @@ Note that the documenation requires 'sphinx', which is usually part of your python distribution. +Installation from source +------------------------ + +CSO can be installed from source in either conda or virtual environments. + +**Pip** + +The file py_project.toml contains the dependencies needed by CSO. + + python3 -m venv --prompt cso .venv + +This will create a new Python evironment folder called `cso`. To activate it run + + source .venv/bin/activate + +You may need to updated pip with the command + + pip install -U pip + +We can then install CSO and its dependencies simply using pip + + pip install -e . + +The `-e` flag installs CSO in editable mode, meaning that the user can change the source code and run CSO anywhere using these changes. + + Tutorial -------- diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000000000000000000000000000000000000..b0e7ae6d445196c72585a30132d658f2e38a1836 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,47 @@ +[build-system] +requires = ["setuptools >= 40.9.0"] +build-backend = "setuptools.build_meta" + +[project] +name = "cso" +version = "0.1.0" +authors = [{ name = "Arjo Segers" }] +description = "CAMS Satellite Operator (CSO) tool." +readme = "README.md" +classifiers = [ + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "License :: MIT", + "Operating System :: OS Independent", + "Development Status :: 3 - Alpha", + "Intended Audience :: Science/Research", + "Intended Audience :: Education", + "Topic :: Scientific/Engineering :: Atmospheric Science", +] +requires-python = ">=3.10" + +dependencies = [ + "cartopy>=0.20", + "shapely", + "numpy", + "matplotlib", + "numba", + "pandas", + "tqdm", + "xarray", + "netcdf4", + "scipy >=1.1.0", + "requests", + "typer", +] + +[project.urls] +Home = "https://ci.tno.nl/gitlab/cams/cso" + +[project.optional-dependencies] +docs = ["pre-commit"] + +[project.scripts] +cso = "cso.scripts.cli:main" diff --git a/src/cso/__init__.py b/src/cso/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..85a1b92969568095e9eae48104131927260e32cc --- /dev/null +++ b/src/cso/__init__.py @@ -0,0 +1,20 @@ +from importlib import metadata + +__version__ = metadata.version(__package__) + +from .cso_file import * +from .cso_catalogue import * +from .cso_inquire import * + +# from .cso_scihub import * +from .cso_pal import * +from .cso_s5p import * +from .cso_superobs import * +from .cso_gridded import * +from .cso_colocate import * +from .cso_superobs import * +from .cso_regions import * +from .cso_constants import * +from .cso_mapping import * +from .cso_plot import * +from .cso_dataspace import * \ No newline at end of file diff --git a/py/cso.py b/src/cso/cso.py similarity index 100% rename from py/cso.py rename to src/cso/cso.py diff --git a/py/cso_catalogue.py b/src/cso/cso_catalogue.py similarity index 99% rename from py/cso_catalogue.py rename to src/cso/cso_catalogue.py index 4b49d8fbdb12a7552d4882184a1fecd4f4b50e17..e27d04b3053273ff9a3fb92f3a25c7a080df14c5 100644 --- a/py/cso_catalogue.py +++ b/src/cso/cso_catalogue.py @@ -114,7 +114,7 @@ class CSO_CatalogueBase(utopya.UtopyaRc): import numpy # tools: - import cso_constants + from . import cso_constants # no target units defined? if (vunits is None) or (vunits == "None"): @@ -278,8 +278,8 @@ class CSO_Catalogue(CSO_CatalogueBase): import matplotlib.pyplot as plt # tools: - import cso_file - import cso_plot + from . import cso_file + from . import cso_plot # setup graphics back-end: matplotlib.use("Agg") @@ -660,8 +660,8 @@ class CSO_SimCatalogue(CSO_CatalogueBase): import matplotlib.pyplot as plt # tools: - import cso_file - import cso_plot + from . import cso_file + from . import cso_plot # setup graphics back-end: matplotlib.use("Agg") @@ -1008,8 +1008,8 @@ class CSO_GriddedCatalogue(CSO_CatalogueBase): import matplotlib.pyplot as plt # tools: - import cso_file - import cso_plot + from . import cso_file + from . import cso_plot # setup graphics back-end: matplotlib.use("Agg") diff --git a/py/cso_colhub.py b/src/cso/cso_colhub.py similarity index 99% rename from py/cso_colhub.py rename to src/cso/cso_colhub.py index 26aff59b551c71e863b4778f56d596bcc3e57074..8f179ecf01d37466c5dd46dca142708df8aa93e2 100644 --- a/py/cso_colhub.py +++ b/src/cso/cso_colhub.py @@ -148,7 +148,7 @@ class CSO_ColHubMirror_Inquire(utopya.UtopyaRc): import fnmatch # tools: - import cso_file + from . import cso_file # info ... logging.info(f"{indent}") @@ -375,7 +375,7 @@ class CSO_ColHubMirror_Missing(utopya.UtopyaRc): import fnmatch # tools: - import cso_file + from . import cso_file # info ... logging.info(f"{indent}") diff --git a/py/cso_colocate.py b/src/cso/cso_colocate.py similarity index 99% rename from py/cso_colocate.py rename to src/cso/cso_colocate.py index 8b208ab459d26dff85b076a29c6d68de06260a64..24a7b05ed860c89ea65d95b508ed79fca15246d7 100644 --- a/py/cso_colocate.py +++ b/src/cso/cso_colocate.py @@ -56,7 +56,7 @@ import logging # tools: import utopya -import cso_catalogue +from . import cso_catalogue ######################################################################## @@ -191,8 +191,8 @@ class CSO_CoLocate(utopya.UtopyaRc): import xarray # tools: - import cso_file - import cso_mapping + from . import cso_file + from . import cso_mapping # init base object: utopya.UtopyaRc.__init__(self, rcfile, rcbase=rcbase, env=env) diff --git a/py/cso_constants.py b/src/cso/cso_constants.py similarity index 100% rename from py/cso_constants.py rename to src/cso/cso_constants.py diff --git a/py/cso_dataspace.py b/src/cso/cso_dataspace.py similarity index 99% rename from py/cso_dataspace.py rename to src/cso/cso_dataspace.py index e240a90ee4cde9231f140b29cfad3bd46d499f38..8250df3f7d0bf8c6622c097c8b589751031d269f 100644 --- a/py/cso_dataspace.py +++ b/src/cso/cso_dataspace.py @@ -776,7 +776,7 @@ class CSO_DataSpace_Downloader(object): import shutil # tools: - import cso_file + from . import cso_file # no token yet? if self.access_token is None: diff --git a/py/cso_earthaccess.py b/src/cso/cso_earthaccess.py similarity index 99% rename from py/cso_earthaccess.py rename to src/cso/cso_earthaccess.py index 74cbefb2ed53a50c94c7c7a39873e6c0f442c7d9..c147774e9452935b395e7bdc749751160e8cd223 100644 --- a/py/cso_earthaccess.py +++ b/src/cso/cso_earthaccess.py @@ -158,7 +158,7 @@ class CSO_EarthAccess_Inquire(utopya.UtopyaRc): import pandas # tools: - import cso_file + from . import cso_file # info ... logging.info(f"{indent}") @@ -491,7 +491,7 @@ class CSO_EarthAccess_Download(utopya.UtopyaRc): import earthaccess # tools: - import cso_file + from . import cso_file # info ... logging.info(f"{indent}") diff --git a/py/cso_file.py b/src/cso/cso_file.py similarity index 99% rename from py/cso_file.py rename to src/cso/cso_file.py index 2d5ee2d54a713475015f78c5ae803c85b6ab6a60..ee7024d35a09fe68d1a753787b260920bc7d2f94 100644 --- a/py/cso_file.py +++ b/src/cso/cso_file.py @@ -1,4 +1,3 @@ -# # Changes # # 2022-09, Arjo Segers diff --git a/py/cso_gridded.py b/src/cso/cso_gridded.py similarity index 99% rename from py/cso_gridded.py rename to src/cso/cso_gridded.py index b5f01829d6dfb3c9e116cf250cfbd38d58f7488f..ca7b4c9ed9d6b1c7fd345471eb5389fe4c956662 100644 --- a/py/cso_gridded.py +++ b/src/cso/cso_gridded.py @@ -267,8 +267,8 @@ class CSO_GriddedAverage(utopya.UtopyaRc): import pandas # tools: - import cso_file - import cso_mapping + from . import cso_file + from . import cso_mapping # init base object: utopya.UtopyaRc.__init__(self, rcfile, rcbase=rcbase, env=env) @@ -1210,7 +1210,7 @@ class CSO_GriddedAverageMeans(utopya.UtopyaRc): import pandas # tools: - import cso_file + from . import cso_file # init base object: utopya.UtopyaRc.__init__(self, rcfile, rcbase=rcbase, env=env) diff --git a/py/cso_inquire.py b/src/cso/cso_inquire.py similarity index 99% rename from py/cso_inquire.py rename to src/cso/cso_inquire.py index 9c19a0fe4779d8e7f52fc668a16d76643ad85fb7..875d7398fdbaa78bb45871b29ba8fd3e7b9af76c 100644 --- a/py/cso_inquire.py +++ b/src/cso/cso_inquire.py @@ -1,4 +1,3 @@ -# # CSO data archive inquiry tools. # # CHANGES @@ -151,7 +150,7 @@ class CSO_Inquire_Plot(utopya.UtopyaRc): import matplotlib.dates as mdates # tools: - import cso_file + from . import cso_file # setup graphics back-end: matplotlib.use("Agg") @@ -226,8 +225,6 @@ class CSO_Inquire_Plot(utopya.UtopyaRc): skip_blank_lines=True, dtype="str", ) - # convert datetime columns, as the default is "str" - # the "parse_dates" argument could not be used: xdf["start_time"] = pandas.to_datetime( xdf["start_time"] ) xdf["end_time"] = pandas.to_datetime( xdf["end_time"] ) # combine: diff --git a/py/cso_mapping.py b/src/cso/cso_mapping.py similarity index 100% rename from py/cso_mapping.py rename to src/cso/cso_mapping.py diff --git a/py/cso_pal.py b/src/cso/cso_pal.py similarity index 99% rename from py/cso_pal.py rename to src/cso/cso_pal.py index 502991a05d123a266676f43a2787e3683bbcd400..e13aefc5d15d7080b936e29e045f2869dc8c638a 100644 --- a/py/cso_pal.py +++ b/src/cso/cso_pal.py @@ -397,7 +397,7 @@ class CSO_PAL_Downloader(object): import requests # tools: - import cso_file + from . import cso_file # retry loop .. ntry = 1 diff --git a/py/cso_plot.py b/src/cso/cso_plot.py similarity index 100% rename from py/cso_plot.py rename to src/cso/cso_plot.py diff --git a/py/cso_regions.py b/src/cso/cso_regions.py similarity index 99% rename from py/cso_regions.py rename to src/cso/cso_regions.py index d8db155a364f81a187cca6bfd8bee55c2a336e3e..142462064fe607d6f4fe2f5a85979c1902df5251 100644 --- a/py/cso_regions.py +++ b/src/cso/cso_regions.py @@ -74,7 +74,7 @@ import logging # tools: import utopya -import cso_catalogue +from . import cso_catalogue ######################################################################## @@ -1703,9 +1703,9 @@ class CSO_Catalogue_RegionsMaps(cso_catalogue.CSO_CatalogueBase): import matplotlib.pyplot as plt # tools: - import cso_file - import cso_plot - import cso_regions + from . import cso_file + from . import cso_plot + from . import cso_regions # setup graphics back-end: matplotlib.use("Agg") @@ -2063,9 +2063,9 @@ class CSO_Catalogue_RegionsTimeSeries(cso_catalogue.CSO_CatalogueBase): import xarray # tools: - import cso_file - import cso_plot - import cso_regions + from . import cso_file + from . import cso_plot + from . import cso_regions # setup graphics back-end: matplotlib.use("Agg") diff --git a/py/cso_s5p.py b/src/cso/cso_s5p.py similarity index 99% rename from py/cso_s5p.py rename to src/cso/cso_s5p.py index 60976ac9bcff2f0bcb09b6e2263935424293c2d6..ed3dcf86bf8db1ba956a9c15c00cb333f678d7ef 100644 --- a/py/cso_s5p.py +++ b/src/cso/cso_s5p.py @@ -123,7 +123,7 @@ import logging # tools: import utopya -import cso_file +from . import cso_file ######################################################################## @@ -2724,9 +2724,9 @@ class CSO_S5p_Convert(utopya.UtopyaRc): import pandas # tools: - import cso_file - import cso_dataspace - import cso_pal + from . import cso_file + from . import cso_dataspace + from . import cso_pal import utopya # info ... @@ -3231,8 +3231,8 @@ class CSO_S5p_Download(utopya.UtopyaRc): import pandas # tools: - import cso_dataspace - import cso_pal + from . import cso_dataspace + from . import cso_pal # info ... logging.info(f"{indent}") @@ -3559,7 +3559,7 @@ class CSO_S5p_Listing(utopya.UtopyaRc): import glob # tools: - import cso_file + from . import cso_file # info ... logging.info(f"{indent}") @@ -3786,7 +3786,7 @@ class CSO_S5p_Download_Listing(utopya.UtopyaRc): import collections # tools: - import cso_file + from . import cso_file # info ... logging.info(f"{indent}") diff --git a/py/cso_superobs.py b/src/cso/cso_superobs.py similarity index 99% rename from py/cso_superobs.py rename to src/cso/cso_superobs.py index a0d3394a8ecd0c1e30403e4ce02f77c96a190bb2..79a75a69d2357b1b461b6b64b8bf987701093adb 100644 --- a/py/cso_superobs.py +++ b/src/cso/cso_superobs.py @@ -191,8 +191,8 @@ class CSO_SuperObs(utopya.UtopyaRc): import pandas # tools: - import cso_file - import cso_mapping + from . import cso_file + from . import cso_mapping # init base object: utopya.UtopyaRc.__init__(self, rcfile, rcbase=rcbase, env=env) diff --git a/py/cso_tools.py b/src/cso/cso_tools.py similarity index 100% rename from py/cso_tools.py rename to src/cso/cso_tools.py diff --git a/src/cso/scripts/__init__.py b/src/cso/scripts/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/cso/scripts/cli.py b/src/cso/scripts/cli.py new file mode 100644 index 0000000000000000000000000000000000000000..27e5c1323583a596c097cabc655d625b6d4d445f --- /dev/null +++ b/src/cso/scripts/cli.py @@ -0,0 +1,96 @@ +import subprocess +from typing import Optional + +import typer +import sys +import os +import webbrowser + +from cso import __package__, __version__ + +# import utopya + +# prefix of CSO installation: +prefix = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), os.pardir)) +# extend path: +sys.path.insert(0, os.path.join(prefix, "src/cso")) +sys.path.insert(0, os.path.join(prefix, "src/utopya")) + +main = typer.Typer() + + +def version_callback(value: bool): + if not value: + return + typer.echo(f"🛰️ {__package__} {__version__}") + raise typer.Exit() + + +@main.callback() +def callback( + version: Optional[bool] = typer.Option(None, "--version", "-V", callback=version_callback), +): + """🛰️ CAMS Satellite Operator (CSO) Command Line Interface""" + +@main.command() +def run(rc_file: str = typer.Argument(..., help="Provide .rc file")): + """Run cso based on settings provided in .rc file (e.g., cso run config/tutorial/tutorial.rc)""" + raise NotImplementedError + # # set environment: + # os.environ["CSO_PREFIX"] = prefix + # # dummy values to ensure that settings could be read first to setup logging: + # os.environ["CSO_RCFILE"] = "None" + # os.environ["CSO_RCDIR"] = "None" + + # # init script: + # utos = utopya.UtopyaRunScriptRc() + + # # setup standard command line arguments, and also enable rcfile arguments: + # utos.ArgumentsSetup(description="CAMS Satellite Operator", rcbase="cso") + + # # evaluate known arguments, store the other ; + # # might show help text and exit: + # args, xargs = utos.ArgumentsParse() + + # # store full path to settings: + # os.environ["CSO_RCFILE"] = os.path.abspath(args.rcfile) + # # location of settings file: + # os.environ["CSO_RCDIR"] = os.path.dirname(os.path.abspath(args.rcfile)) + + # # start, shout info: + # logging.info(f"") + # logging.info(f"** CSO - CAMS Satellite Operator **") + # logging.info(f"") + # logging.info(f"installation prefix : {prefix}") + # logging.info(f"input rcfile : {args.rcfile}") + # logging.info(f"settings base : {args.rcbase}") + # logging.info(f"") + # logging.info(f"environment:") + # for key in ["CSO_PREFIX", "CSO_RCFILE", "CSO_RCDIR"]: + # logging.info(f" {key} = {os.environ[key]}") + # # endfor + # logging.info(f"") + + # # info ... + # logging.info(f"start job tree ...") + # # import class as defined in settings by 'cso.class' key; + # # should be (derived from) 'utopya.JobStep' : + # jbs_cls = utos.ImportClass("class") + # # init job step object, use the 'rcbase' as name: + # jbs = jbs_cls(args.rcbase, args.rcfile) + # # start first: + # jbs.Start(single=args.single) + + # # info: + # logging.info(f"") + # logging.info(f"** end **") + # logging.info(f"") + + +# ------------------------------------------------- +# end +# ------------------------------------------------- + + +if __name__ == "__main__": + main() diff --git a/py/rc.py b/src/rc.py similarity index 100% rename from py/rc.py rename to src/rc.py diff --git a/src/utopya/__init__.py b/src/utopya/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..cbc5b198ff237d20e82b3433433bb01ab11d5e14 --- /dev/null +++ b/src/utopya/__init__.py @@ -0,0 +1,11 @@ + +from .utopya_base import * +from .utopya_rc import * +from .utopya_jobscript import * +from .utopya_jobtree import * +from .utopya_runscript import * + +# from utopya_install import * +from .utopya_tools import * +from .utopya_index import * +from .utopya_post import * \ No newline at end of file diff --git a/py/utopya.py b/src/utopya/utopya.py similarity index 94% rename from py/utopya.py rename to src/utopya/utopya.py index 277ea0f28e114650f5a0449cdbee30ce4187083b..5fc65dc267e9bba4b4c0c31e3f714d65d024b176 100644 --- a/py/utopya.py +++ b/src/utopya/utopya.py @@ -152,15 +152,15 @@ and are defined according to the following hierchy: # imports from sub modules # ------------------------------------------------- -from utopya_base import * -from utopya_rc import * -from utopya_jobscript import * -from utopya_jobtree import * -from utopya_runscript import * -from utopya_tools import * -from utopya_build import * -from utopya_index import * -from utopya_post import * +from .utopya_base import * +from .utopya_rc import * +from .utopya_jobscript import * +from .utopya_jobtree import * +from .utopya_runscript import * +from .utopya_tools import * +from .utopya_build import * +from .utopya_index import * +from .utopya_post import * # ------------------------------------------------- diff --git a/py/utopya_base.py b/src/utopya/utopya_base.py similarity index 100% rename from py/utopya_base.py rename to src/utopya/utopya_base.py diff --git a/py/utopya_build.py b/src/utopya/utopya_build.py similarity index 99% rename from py/utopya_build.py rename to src/utopya/utopya_build.py index 69f7f081006ec9edbd59c6102b7e545f168e2507..8231fc95258074833e291b2f937b7189e578d37c 100644 --- a/py/utopya_build.py +++ b/src/utopya/utopya_build.py @@ -106,7 +106,7 @@ Classes import logging # tools: -import utopya_rc +from . import utopya_rc # ------------------------------------------------- @@ -303,7 +303,7 @@ class UtopyaCopy(utopya_rc.UtopyaRc): import os # tools: - import utopya_tools + from . import utopya_tools # init base object: utopya_rc.UtopyaRc.__init__(self, rcfile=rcfile, rcbase=rcbase, env=env) @@ -797,7 +797,7 @@ class UtopyaConfigure(utopya_rc.UtopyaRc): import glob # tools: - import utopya_tools + from . import utopya_tools # info ... logging.info("configure source code ...") @@ -1236,7 +1236,7 @@ class UtopyaConfigure(utopya_rc.UtopyaRc): """ # tools: - import utopya_tools + from . import utopya_tools # info... logging.info(" macro definitions ...") @@ -2496,7 +2496,7 @@ class UtopyaDependencies(utopya_rc.UtopyaRc): """ # tools: - import utopya_tools + from . import utopya_tools # external program: prog = "makedepf90" @@ -2689,7 +2689,7 @@ class UtopyaMake(utopya_rc.UtopyaRc): import os # tools: - import utopya_tools + from . import utopya_tools # init base object: utopya_rc.UtopyaRc.__init__(self, rcfile=rcfile, rcbase=rcbase, env=env) diff --git a/py/utopya_index.py b/src/utopya/utopya_index.py similarity index 99% rename from py/utopya_index.py rename to src/utopya/utopya_index.py index cb89cf2630a54590f4087cb9ed399e6006699bed..63aa491c695e4b059eda45e18d983a94534a8db7 100644 --- a/py/utopya_index.py +++ b/src/utopya/utopya_index.py @@ -267,7 +267,7 @@ Classes and methods import logging # tools: -import utopya +from . import utopya # ----------------------------------------------------------------------- @@ -925,7 +925,7 @@ class IndexPart(utopya.UtopyaRc): """ # tools: - import utopya_tools + from . import utopya_tools # read list from settings: line = self.GetSetting(key) diff --git a/py/utopya_jobscript.py b/src/utopya/utopya_jobscript.py similarity index 99% rename from py/utopya_jobscript.py rename to src/utopya/utopya_jobscript.py index dc932019bb95339a0a8ace7465f00e0933ab5cf7..d2afe2d2be1f12ad589cae41945ca1ec33b88e68 100644 --- a/py/utopya_jobscript.py +++ b/src/utopya/utopya_jobscript.py @@ -147,7 +147,7 @@ Classes import logging # tools: -import utopya_base +from . import utopya_base # ====================================================================== diff --git a/py/utopya_jobtree.py b/src/utopya/utopya_jobtree.py similarity index 99% rename from py/utopya_jobtree.py rename to src/utopya/utopya_jobtree.py index 7ae1ff2dd85b66a0df2fe1817b1a6d72311ee7f6..cf3f101082eebef451572fa627d6aece97ff9639 100644 --- a/py/utopya_jobtree.py +++ b/src/utopya/utopya_jobtree.py @@ -105,7 +105,7 @@ Classes import logging # tools: -import utopya_rc +from . import utopya_rc # ====================================================================== @@ -470,7 +470,7 @@ class UtopyaJobStep(utopya_rc.UtopyaRc): import datetime # tools: - import utopya_tools + from . import utopya_tools # defined ? if len(self.logfile) > 0: @@ -3345,7 +3345,7 @@ class UtopyaJobTaskSubmit(UtopyaJobTask): import os # tools: - import utopya + from . import utopya # parent init: UtopyaJobTask.__init__(self, msg=msg) @@ -3526,7 +3526,7 @@ class UtopyaRcCommand(utopya_rc.UtopyaRc): """ # tools: - import utopya_tools + from . import utopya_tools # init base object: utopya_rc.UtopyaRc.__init__(self, rcfile=rcfile, rcbase=rcbase, env=env) @@ -3593,8 +3593,8 @@ class UtopyaJobTreeTiming(utopya_rc.UtopyaRc): import os # tools: - import utopya_tools - import utopya_timing + from . import utopya_tools + from . import utopya_timing # init base object: utopya_rc.UtopyaRc.__init__(self, rcfile=rcfile, rcbase=rcbase, env=env) diff --git a/py/utopya_post.py b/src/utopya/utopya_post.py similarity index 99% rename from py/utopya_post.py rename to src/utopya/utopya_post.py index 0be74905794b895761c5aa27ee742b65915e5a43..2c58c625e8d5c7dfe04cbc79cc19666bbf89aba3 100644 --- a/py/utopya_post.py +++ b/src/utopya/utopya_post.py @@ -52,7 +52,7 @@ Classes import logging # tools: -import utopya_base +from . import utopya_base ############################################################ diff --git a/py/utopya_rc.py b/src/utopya/utopya_rc.py similarity index 99% rename from py/utopya_rc.py rename to src/utopya/utopya_rc.py index 697c1ba651eb60cd5506f7bd0f05ea0bf70238cc..61c2eb028f216637c25afaeec40dc454767b2f56 100644 --- a/py/utopya_rc.py +++ b/src/utopya/utopya_rc.py @@ -44,7 +44,7 @@ Classes import logging # tools: -from utopya_base import UtopyaBase +from .utopya_base import UtopyaBase # ------------------------------------------------- @@ -298,7 +298,7 @@ class UtopyaRc(UtopyaBase): import sys # tools: - import utopya_tools + from . import utopya_tools # name of model module and class: moduleclass = self.GetSetting(name) diff --git a/py/utopya_runscript.py b/src/utopya/utopya_runscript.py similarity index 99% rename from py/utopya_runscript.py rename to src/utopya/utopya_runscript.py index 8612e7462ed92e28f28b98371ef4a4f4c7cd04f6..8782b988ce9ed07d26cc2833b5d496ea3626b93e 100644 --- a/py/utopya_runscript.py +++ b/src/utopya/utopya_runscript.py @@ -53,8 +53,8 @@ Classes import logging # tools: -from utopya_base import UtopyaBase -from utopya_rc import UtopyaRc +from .utopya_base import UtopyaBase +from .utopya_rc import UtopyaRc # ------------------------------------------------- diff --git a/py/utopya_tools.py b/src/utopya/utopya_tools.py similarity index 100% rename from py/utopya_tools.py rename to src/utopya/utopya_tools.py