Skip to content

Commit

Permalink
- Move more modules to private modules
Browse files Browse the repository at this point in the history
  • Loading branch information
byrdie committed Nov 17, 2020
1 parent d17a052 commit ae4c471
Show file tree
Hide file tree
Showing 14 changed files with 18 additions and 15 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import astropy.units as u
import astropy.time
import kgpy.plot
import kgpy.test_obs
import kgpy._obs_test
from . import AIA


Expand All @@ -18,7 +18,7 @@ def obs_test() -> AIA:
return AIA.from_time_range(time_start, time_end, download_path, channels=channels)


class TestAIA(kgpy.test_obs.TestObs):
class TestAIA(kgpy._obs_test.TestObs):

def test_from_time_range(self, obs_test: AIA):
# with capsys.disabled():
Expand Down
17 changes: 10 additions & 7 deletions kgpy/optics/_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,16 @@ class System(
mixin.Broadcastable,
mixin.Named,
):
object_surface: Surface = dataclasses.field(default_factory=Surface)
surfaces: SurfaceList = dataclasses.field(default_factory=SurfaceList)
wavelengths: typ.Optional[u.Quantity] = None
pupil_samples: typ.Union[int, typ.Tuple[int, int]] = 3
pupil_margin: u.Quantity = 1 * u.um
field_samples: typ.Union[int, typ.Tuple[int, int]] = 3
field_margin: u.Quantity = 1 * u.nrad
"""
Model of an optical system.
"""
object_surface: Surface = dataclasses.field(default_factory=Surface) #: Surface representing light source
surfaces: SurfaceList = dataclasses.field(default_factory=SurfaceList) #: All surfaces in the optical system
wavelengths: typ.Optional[u.Quantity] = None #: Source wavelengths
pupil_samples: typ.Union[int, typ.Tuple[int, int]] = 3 #: Number of samples across the pupil for each axis x, y
pupil_margin: u.Quantity = 1 * u.um #: Margin between edge of pupil and nearest ray
field_samples: typ.Union[int, typ.Tuple[int, int]] = 3 #: Number of samples across the field for each axis x, y
field_margin: u.Quantity = 1 * u.nrad #: Margin between edge of field and nearest ray
# baffle_positions: typ.Optional[typ.List[transform.rigid.Transform]] = None

def __post_init__(self):
Expand Down
4 changes: 2 additions & 2 deletions kgpy/optimization/minimization/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
from .golden_section_search import golden_section_search
from .coordinate_descent import coordinate_descent
from ._golden_section_search import golden_section_search
from ._coordinate_descent import coordinate_descent
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import astropy.units as u
from kgpy import vector
from kgpy.vector import x_hat, y_hat, z_hat
from . import tilt
from . import _tilt


class TestTiltX:
Expand All @@ -17,7 +17,7 @@ class TestTiltX:
],
)
def test__call__(self, vec: u.Quantity, angle: u.Quantity, vec_out: u.Quantity):
assert np.isclose(tilt.TiltX(angle)(vec), vec_out).all()
assert np.isclose(_tilt.TiltX(angle)(vec), vec_out).all()


class TestTiltY:
Expand All @@ -31,7 +31,7 @@ class TestTiltY:
],
)
def test__call__(self, vec: u.Quantity, angle: u.Quantity, vec_out: u.Quantity):
assert np.isclose(tilt.TiltY(angle)(vec), vec_out).all()
assert np.isclose(_tilt.TiltY(angle)(vec), vec_out).all()


class TestTiltZ:
Expand All @@ -45,4 +45,4 @@ class TestTiltZ:
],
)
def test__call__(self, vec: u.Quantity, angle: u.Quantity, vec_out: u.Quantity):
assert np.isclose(tilt.TiltZ(angle)(vec), vec_out).all()
assert np.isclose(_tilt.TiltZ(angle)(vec), vec_out).all()
File renamed without changes.

0 comments on commit ae4c471

Please sign in to comment.