Skip to content

Commit

Permalink
For backwards compatibility, export all symbols from compiled extensi…
Browse files Browse the repository at this point in the history
…on to the top-level so3g namespace.
  • Loading branch information
tskisner committed Jan 9, 2025
1 parent 6664258 commit 78eec13
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 10 deletions.
8 changes: 2 additions & 6 deletions python/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,10 @@
from spt3g import core as spt3g_core

# Load all symbols from our compiled extension.
from . import _libso3g as libso3g
# # Our library is called libso3g.{suffix}, but will load into module
# # namespace so3g.
# from .load_pybindings import load_pybindings
# load_pybindings([__path__[0] + '/libso3g'], name='so3g')
from ._libso3g import *

# Version is computed by versioneer.
__version__ = libso3g.version()
__version__ = version()

if os.getenv('DOCS_BUILD') != '1':
# Instance configuration.
Expand Down
4 changes: 2 additions & 2 deletions python/proj/coords.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ def coords(self, det_offsets=None, output=None):
redict = isinstance(det_offsets, dict)
if redict:
keys, det_offsets = zip(*det_offsets.items())
if isinstance(det_offsets[0], quat.quat):
if isinstance(det_offsets[0], quat.Quat):
# Individual quat doesn't array() properly...
det_offsets = np.array(quat.G3VectorQuat(det_offsets))
else:
Expand Down Expand Up @@ -335,7 +335,7 @@ def attach(cls, sight_line, det_offsets):
else:
self.dets = det_offsets
# Make sure it's a numpy array. This is dumb.
if isinstance(self.dets[0], quat.quat):
if isinstance(self.dets[0], quat.Quat):
self.dets = quat.G3VectorQuat(self.dets)
self.dets = np.array(self.dets)
return self
Expand Down
2 changes: 1 addition & 1 deletion python/proj/wcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@ def __init__(self):
self._q_fp_to_celestial = None
self.active_tiles = None
self.proj_name = None
self.q_celestial_to_native = quat.quat(1,0,0,0)
self.q_celestial_to_native = quat.Quat(1,0,0,0)
self.interpol = 'nearest'
self.tiling = None

Expand Down
2 changes: 1 addition & 1 deletion test/test_proj_astro.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def get_pyephem_radec(az, el, t, site, weather=None):
esite.long = site.lon * DEG
if weather is not None:
weather.apply(esite)
d = datetime.datetime.utcfromtimestamp(t)
d = datetime.datetime.fromtimestamp(t, datetime.UTC)
Xt = d.year, d.month, d.day, d.hour, d.minute, d.second+d.microsecond*1e-6
esite.date = ephem.date(Xt)
return esite.radec_of(az, el)
Expand Down

0 comments on commit 78eec13

Please sign in to comment.