Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete redundant vesion.py #355

Merged
merged 2 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions scopesim/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
"""Generalised telescope observation simulator."""

from importlib import metadata

###############################################################################
# VERSION INFORMATION #
###############################################################################

try:
__version__ = metadata.version(__package__)
except metadata.PackageNotFoundError:
__version__ = "undetermined"

Check warning on line 12 in scopesim/__init__.py

View check run for this annotation

Codecov / codecov/patch

scopesim/__init__.py#L11-L12

Added lines #L11 - L12 were not covered by tests


###############################################################################
# TURN OFF WARNINGS #
###############################################################################

import warnings
import yaml
from importlib import metadata
from astropy.utils.exceptions import AstropyWarning

warnings.simplefilter('ignore', UserWarning)
Expand Down Expand Up @@ -58,12 +69,3 @@
list_example_data, download_example_data)

from .tests.mocks.load_basic_instrument import load_example_optical_train

###############################################################################
# VERSION INFORMATION #
###############################################################################

try:
__version__ = metadata.version(__package__)
except metadata.PackageNotFoundError:
__version__ = "undetermined"
5 changes: 2 additions & 3 deletions scopesim/optics/optical_train.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
from ..detector import DetectorArray
from ..effects import ExtraFitsKeywords
from ..utils import from_currsys, top_level_catch
from ..version import version
from .. import rc
from .. import rc, __version__


class OpticalTrain:
Expand Down Expand Up @@ -353,7 +352,7 @@ def write_header(self, hdulist):
# Primary hdu
pheader = hdulist[0].header
pheader["DATE"] = datetime.now().isoformat(timespec="seconds")
pheader["ORIGIN"] = "Scopesim " + version
pheader["ORIGIN"] = f"Scopesim {__version__}"
pheader["INSTRUME"] = from_currsys("!OBS.instrument")
pheader["INSTMODE"] = ", ".join(from_currsys("!OBS.modes"))
pheader["TELESCOP"] = from_currsys("!TEL.telescope")
Expand Down
5 changes: 0 additions & 5 deletions scopesim/version.py

This file was deleted.

Loading