diff --git a/corkit/__init__.py b/corkit/__init__.py index 1c58628..e4de475 100644 --- a/corkit/__init__.py +++ b/corkit/__init__.py @@ -1,10 +1,10 @@ -from corkit._version import __version__ +from ._version import __version__ __author__ = "Jorgedavyd" __email__ = "jorged.encyso@gmail.com" -from corkit.lasco import * -from corkit.reconstruction import * +from .lasco import * +from .reconstruction import * # from corkit.secchi import * -from corkit.dataset import * +from .dataset import * diff --git a/corkit/dataset.py b/corkit/dataset.py index 256fc6b..f2d52a3 100644 --- a/corkit/dataset.py +++ b/corkit/dataset.py @@ -1,4 +1,4 @@ -from corkit.utils import DEFAULT_SAVE_DIR, datetime_interval +from .utils import DEFAULT_SAVE_DIR, datetime_interval from dateutil.relativedelta import relativedelta from datetime import datetime, timedelta from collections import defaultdict @@ -13,7 +13,7 @@ import os from dataclasses import dataclass -from corkit import __version__ +from . import __version__ __all__ = ["update", "CorKitDatasets"] @@ -251,7 +251,7 @@ async def medv_update(): from torchvision.transforms import Compose, Resize, ToTensor, Lambda from astropy.visualization import ImageNormalize, HistEqStretch from torch import Tensor -from corkit.lasco import CME +from .lasco import CME from astropy.io import fits @@ -319,7 +319,3 @@ def __getitem__(self, idx) -> Tensor: out = self._forward(idx) out = self.transforms(out) return out - - -if __name__ == "__main__": - asyncio.run(update()) diff --git a/corkit/lasco.py b/corkit/lasco.py index 1f60a11..99cc130 100644 --- a/corkit/lasco.py +++ b/corkit/lasco.py @@ -1,6 +1,6 @@ """Utils dependencies""" -from corkit.utils import ( +from .utils import ( FITS, fixwrap, c2_warp, @@ -45,7 +45,7 @@ import glob import os -from corkit import __version__ +from . import __version__ __all__ = ["level_1", "CME", "LASCOplot", "downloader", "c3_calibrate", "c2_calibrate"] diff --git a/corkit/reconstruction.py b/corkit/reconstruction.py index b0522fc..9e136bf 100644 --- a/corkit/reconstruction.py +++ b/corkit/reconstruction.py @@ -1,10 +1,9 @@ from skimage.restoration import inpaint from scipy.fft import fft, ifft import numpy as np -from torch import nn -from corkit.utils import deprecation +from .utils import deprecation -from corkit import __version__ +from . import __version__ def image_reconstruction(img: np.array): diff --git a/corkit/secchi.py b/corkit/secchi.py index 07de57e..5219fa4 100644 --- a/corkit/secchi.py +++ b/corkit/secchi.py @@ -1,9 +1,9 @@ """COR 2 & COR 1""" import numpy as np -from corkit.utils import FITS +from .utils import FITS -from corkit import __version__ +from . import __version__ # class downloader(): diff --git a/corkit/utils.py b/corkit/utils.py index 00bec53..006e227 100644 --- a/corkit/utils.py +++ b/corkit/utils.py @@ -15,7 +15,7 @@ import glob import os -from corkit import __version__ +from . import __version__ radeg = 180 / np.pi diff --git a/setup.py b/setup.py index df6efa8..67583f4 100644 --- a/setup.py +++ b/setup.py @@ -1,11 +1,12 @@ from setuptools import setup, find_packages from setuptools.command.install import install -import subprocess -import sys import os + from corkit import __version__ +from corkit.dataset import update from pathlib import Path +import asyncio this_directory = Path(__file__).parent long_description = (this_directory / "README.md").read_text() @@ -14,7 +15,7 @@ class InstallDataset(install): def run(self): install.run(self) - subprocess.check_call([sys.executable, "corkit/dataset.py"]) + asyncio.run(update()) def find_calibration_files(): @@ -51,6 +52,8 @@ def find_calibration_files(): "matplotlib", "pillow", "pandas", + "torch", + "torchvision", ], cmdclass={"install": InstallDataset}, classifiers=[