Skip to content

Commit

Permalink
Merge pull request #7 from SOFIA-USRA/IRSA-5626_update_workflow_new
Browse files Browse the repository at this point in the history
IRSA-5626_update_workflow_new
  • Loading branch information
tyb987 committed Feb 5, 2024
2 parents 9a7cd9f + a7a77e9 commit 92ea2f4
Show file tree
Hide file tree
Showing 12 changed files with 300 additions and 276 deletions.
48 changes: 25 additions & 23 deletions sofia_redux/_astropy_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@

if not _ASTROPY_SETUP_: # noqa
import os
from warnings import warn
from astropy.config.configuration import (
update_default_config,
ConfigurationDefaultMissingError,
ConfigurationDefaultMissingWarning)
# from warnings import warn
# Deprecated
# from astropy.config.configuration import (
# update_default_config,
# ConfigurationDefaultMissingError,
# ConfigurationDefaultMissingWarning)

# Create the test function for self test
from astropy.tests.runner import TestRunner
Expand All @@ -32,21 +33,22 @@
# add these here so we only need to cleanup the namespace at the end
config_dir = None

if not os.environ.get('ASTROPY_SKIP_CONFIG_UPDATE', False):
config_dir = os.path.dirname(__file__)
config_template = os.path.join(config_dir, __package__ + ".cfg")
if os.path.isfile(config_template):
try:
update_default_config(
__package__, config_dir, version=__version__)
except TypeError as orig_error:
try:
update_default_config(__package__, config_dir)
except ConfigurationDefaultMissingError as e:
wmsg = (e.args[0]
+ " Cannot install default profile. If you are "
"importing from source, this is expected.")
warn(ConfigurationDefaultMissingWarning(wmsg))
del e
except Exception:
raise orig_error
# Deprecated
# if not os.environ.get('ASTROPY_SKIP_CONFIG_UPDATE', False):
# config_dir = os.path.dirname(__file__)
# config_template = os.path.join(config_dir, __package__ + ".cfg")
# if os.path.isfile(config_template):
# try:
# update_default_config(
# __package__, config_dir, version=__version__)
# except TypeError as orig_error:
# try:
# update_default_config(__package__, config_dir)
# except ConfigurationDefaultMissingError as e:
# wmsg = (e.args[0]
# + " Cannot install default profile. If you are "
# "importing from source, this is expected.")
# warn(ConfigurationDefaultMissingWarning(wmsg))
# del e
# except Exception:
# raise orig_error
48 changes: 25 additions & 23 deletions sofia_redux/calibration/_astropy_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@

if not _ASTROPY_SETUP_: # noqa
import os
from warnings import warn
from astropy.config.configuration import (
update_default_config,
ConfigurationDefaultMissingError,
ConfigurationDefaultMissingWarning)
# from warnings import warn
# Deprecated
# from astropy.config.configuration import (
# update_default_config,
# ConfigurationDefaultMissingError,
# ConfigurationDefaultMissingWarning)

# Create the test function for self test
from astropy.tests.runner import TestRunner
Expand All @@ -32,21 +33,22 @@
# add these here so we only need to cleanup the namespace at the end
config_dir = None

if not os.environ.get('ASTROPY_SKIP_CONFIG_UPDATE', False):
config_dir = os.path.dirname(__file__)
config_template = os.path.join(config_dir, __package__ + ".cfg")
if os.path.isfile(config_template):
try:
update_default_config(
__package__, config_dir, version=__version__)
except TypeError as orig_error:
try:
update_default_config(__package__, config_dir)
except ConfigurationDefaultMissingError as e:
wmsg = (e.args[0]
+ " Cannot install default profile. If you are "
"importing from source, this is expected.")
warn(ConfigurationDefaultMissingWarning(wmsg))
del e
except Exception:
raise orig_error
# Deprecated
# if not os.environ.get('ASTROPY_SKIP_CONFIG_UPDATE', False):
# config_dir = os.path.dirname(__file__)
# config_template = os.path.join(config_dir, __package__ + ".cfg")
# if os.path.isfile(config_template):
# try:
# update_default_config(
# __package__, config_dir, version=__version__)
# except TypeError as orig_error:
# try:
# update_default_config(__package__, config_dir)
# except ConfigurationDefaultMissingError as e:
# wmsg = (e.args[0]
# + " Cannot install default profile. If you are "
# "importing from source, this is expected.")
# warn(ConfigurationDefaultMissingWarning(wmsg))
# del e
# except Exception:
# raise orig_error
48 changes: 25 additions & 23 deletions sofia_redux/instruments/exes/_astropy_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@

if not _ASTROPY_SETUP_: # noqa
import os
from warnings import warn
from astropy.config.configuration import (
update_default_config,
ConfigurationDefaultMissingError,
ConfigurationDefaultMissingWarning)
# from warnings import warn
# Deprecated
# from astropy.config.configuration import (
# update_default_config,
# ConfigurationDefaultMissingError,
# ConfigurationDefaultMissingWarning)

# Create the test function for self test
from astropy.tests.runner import TestRunner
Expand All @@ -38,21 +39,22 @@
# add these here so we only need to cleanup the namespace at the end
config_dir = None

if not os.environ.get('ASTROPY_SKIP_CONFIG_UPDATE', False):
config_dir = os.path.dirname(__file__)
config_template = os.path.join(config_dir, __package__ + ".cfg")
if os.path.isfile(config_template):
try:
update_default_config(
__package__, config_dir, version=__version__)
except TypeError as orig_error:
try:
update_default_config(__package__, config_dir)
except ConfigurationDefaultMissingError as e:
wmsg = (e.args[0]
+ " Cannot install default profile. If you are "
"importing from source, this is expected.")
warn(ConfigurationDefaultMissingWarning(wmsg))
del e
except Exception:
raise orig_error
# Deprecated
# if not os.environ.get('ASTROPY_SKIP_CONFIG_UPDATE', False):
# config_dir = os.path.dirname(__file__)
# config_template = os.path.join(config_dir, __package__ + ".cfg")
# if os.path.isfile(config_template):
# try:
# update_default_config(
# __package__, config_dir, version=__version__)
# except TypeError as orig_error:
# try:
# update_default_config(__package__, config_dir)
# except ConfigurationDefaultMissingError as e:
# wmsg = (e.args[0]
# + " Cannot install default profile. If you are "
# "importing from source, this is expected.")
# warn(ConfigurationDefaultMissingWarning(wmsg))
# del e
# except Exception:
# raise orig_error
48 changes: 25 additions & 23 deletions sofia_redux/instruments/fifi_ls/_astropy_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@

if not _ASTROPY_SETUP_: # noqa
import os
from warnings import warn
from astropy.config.configuration import (
update_default_config,
ConfigurationDefaultMissingError,
ConfigurationDefaultMissingWarning)
# from warnings import warn
# Deprecated
# from astropy.config.configuration import (
# update_default_config,
# ConfigurationDefaultMissingError,
# ConfigurationDefaultMissingWarning)

# Create the test function for self test
from astropy.tests.runner import TestRunner
Expand All @@ -32,21 +33,22 @@
# add these here so we only need to cleanup the namespace at the end
config_dir = None

if not os.environ.get('ASTROPY_SKIP_CONFIG_UPDATE', False):
config_dir = os.path.dirname(__file__)
config_template = os.path.join(config_dir, __package__ + ".cfg")
if os.path.isfile(config_template):
try:
update_default_config(
__package__, config_dir, version=__version__)
except TypeError as orig_error:
try:
update_default_config(__package__, config_dir)
except ConfigurationDefaultMissingError as e:
wmsg = (e.args[0]
+ " Cannot install default profile. If you are "
"importing from source, this is expected.")
warn(ConfigurationDefaultMissingWarning(wmsg))
del e
except Exception:
raise orig_error
# Deprecated
# if not os.environ.get('ASTROPY_SKIP_CONFIG_UPDATE', False):
# config_dir = os.path.dirname(__file__)
# config_template = os.path.join(config_dir, __package__ + ".cfg")
# if os.path.isfile(config_template):
# try:
# update_default_config(
# __package__, config_dir, version=__version__)
# except TypeError as orig_error:
# try:
# update_default_config(__package__, config_dir)
# except ConfigurationDefaultMissingError as e:
# wmsg = (e.args[0]
# + " Cannot install default profile. If you are "
# "importing from source, this is expected.")
# warn(ConfigurationDefaultMissingWarning(wmsg))
# del e
# except Exception:
# raise orig_error
48 changes: 25 additions & 23 deletions sofia_redux/instruments/flitecam/_astropy_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@

if not _ASTROPY_SETUP_: # noqa
import os
from warnings import warn
from astropy.config.configuration import (
update_default_config,
ConfigurationDefaultMissingError,
ConfigurationDefaultMissingWarning)
# from warnings import warn
# Deprecated
# from astropy.config.configuration import (
# update_default_config,
# ConfigurationDefaultMissingError,
# ConfigurationDefaultMissingWarning)

# Create the test function for self test
from astropy.tests.runner import TestRunner
Expand All @@ -32,21 +33,22 @@
# add these here so we only need to cleanup the namespace at the end
config_dir = None

if not os.environ.get('ASTROPY_SKIP_CONFIG_UPDATE', False):
config_dir = os.path.dirname(__file__)
config_template = os.path.join(config_dir, __package__ + ".cfg")
if os.path.isfile(config_template):
try:
update_default_config(
__package__, config_dir, version=__version__)
except TypeError as orig_error:
try:
update_default_config(__package__, config_dir)
except ConfigurationDefaultMissingError as e:
wmsg = (e.args[0]
+ " Cannot install default profile. If you are "
"importing from source, this is expected.")
warn(ConfigurationDefaultMissingWarning(wmsg))
del e
except Exception:
raise orig_error
# Deprecated
# if not os.environ.get('ASTROPY_SKIP_CONFIG_UPDATE', False):
# config_dir = os.path.dirname(__file__)
# config_template = os.path.join(config_dir, __package__ + ".cfg")
# if os.path.isfile(config_template):
# try:
# update_default_config(
# __package__, config_dir, version=__version__)
# except TypeError as orig_error:
# try:
# update_default_config(__package__, config_dir)
# except ConfigurationDefaultMissingError as e:
# wmsg = (e.args[0]
# + " Cannot install default profile. If you are "
# "importing from source, this is expected.")
# warn(ConfigurationDefaultMissingWarning(wmsg))
# del e
# except Exception:
# raise orig_error
48 changes: 25 additions & 23 deletions sofia_redux/instruments/forcast/_astropy_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@

if not _ASTROPY_SETUP_: # noqa
import os
from warnings import warn
from astropy.config.configuration import (
update_default_config,
ConfigurationDefaultMissingError,
ConfigurationDefaultMissingWarning)
# from warnings import warn
# Deprecated
# from astropy.config.configuration import (
# update_default_config,
# ConfigurationDefaultMissingError,
# ConfigurationDefaultMissingWarning)

# Create the test function for self test
from astropy.tests.runner import TestRunner
Expand All @@ -32,21 +33,22 @@
# add these here so we only need to cleanup the namespace at the end
config_dir = None

if not os.environ.get('ASTROPY_SKIP_CONFIG_UPDATE', False):
config_dir = os.path.dirname(__file__)
config_template = os.path.join(config_dir, __package__ + ".cfg")
if os.path.isfile(config_template):
try:
update_default_config(
__package__, config_dir, version=__version__)
except TypeError as orig_error:
try:
update_default_config(__package__, config_dir)
except ConfigurationDefaultMissingError as e:
wmsg = (e.args[0]
+ " Cannot install default profile. If you are "
"importing from source, this is expected.")
warn(ConfigurationDefaultMissingWarning(wmsg))
del e
except Exception:
raise orig_error
# Deprecated
# if not os.environ.get('ASTROPY_SKIP_CONFIG_UPDATE', False):
# config_dir = os.path.dirname(__file__)
# config_template = os.path.join(config_dir, __package__ + ".cfg")
# if os.path.isfile(config_template):
# try:
# update_default_config(
# __package__, config_dir, version=__version__)
# except TypeError as orig_error:
# try:
# update_default_config(__package__, config_dir)
# except ConfigurationDefaultMissingError as e:
# wmsg = (e.args[0]
# + " Cannot install default profile. If you are "
# "importing from source, this is expected.")
# warn(ConfigurationDefaultMissingWarning(wmsg))
# del e
# except Exception:
# raise orig_error
Loading

0 comments on commit 92ea2f4

Please sign in to comment.