diff --git a/.ruff.toml b/.ruff.toml deleted file mode 100644 index 7eb1bc9..0000000 --- a/.ruff.toml +++ /dev/null @@ -1,8 +0,0 @@ -ignore = ["E203", "E226", "E228", "E999", "N802", "N803", "N806", "N812", "N813", "N815", "N816", "N999"] -line-length = 110 -exclude = ["__init__.py", "doc/conf.py"] -select = ["E", "F", "N", "W"] -[pycodestyle] -max-doc-length = 79 -[pydocstyle] -convention = "numpy" diff --git a/bin.src/imgClosedLoop.py b/bin.src/img_closed_loop.py similarity index 97% rename from bin.src/imgClosedLoop.py rename to bin.src/img_closed_loop.py index 863f3be..86bbfb9 100644 --- a/bin.src/imgClosedLoop.py +++ b/bin.src/img_closed_loop.py @@ -24,7 +24,7 @@ import argparse import logging -from lsst.ts.imsim.closedLoopTask import ClosedLoopTask +from lsst.ts.imsim.closed_loop_task import ClosedLoopTask if __name__ == "__main__": # Set the parser diff --git a/doc/user-guide/user-guide.rst b/doc/user-guide/user-guide.rst index 0a23abc..d7ab5ca 100644 --- a/doc/user-guide/user-guide.rst +++ b/doc/user-guide/user-guide.rst @@ -4,7 +4,7 @@ User Guide ##################### -The `ts_imsim` closed loop is designed to run as an executable through the command line as `imgClosedLoop.py`. +The `ts_imsim` closed loop is designed to run as an executable through the command line as `img_closed_loop.py`. .. _Installing_ts_imsim: @@ -46,13 +46,13 @@ Using `ts_imsim` Running the AOS Closed Loop --------------------------- -The closed loop is available from the command line after running `scons` with the command `imgClosedLoop.py`. +The closed loop is available from the command line after running `scons` with the command `img_closed_loop.py`. A sample command to run 5 iterations of the closed loop with the lsst wavefront sensors is: .. code-block:: python - imgClosedLoop.py --output cwfs_imsim_output/ --iter_num 5 --config_pointer_file ts_imsim/policy/config/lsstCamNoPertPointer.yaml --turn_off_atmosphere --turn_off_sky_background + img_closed_loop.py --output cwfs_imsim_output/ --iter_num 5 --config_pointer_file ts_imsim/policy/config/lsstCamNoPertPointer.yaml --turn_off_atmosphere --turn_off_sky_background where the following minimal set of command line options are used: diff --git a/doc/versionHistory.rst b/doc/versionHistory.rst index cacc258..3c107ea 100644 --- a/doc/versionHistory.rst +++ b/doc/versionHistory.rst @@ -7,10 +7,12 @@ Version History ################## ------------- -0.6.4 +0.7.0 ------------- * Add T&S pre-commit settings to ts_imsim. +* Change file names to snake_case. +* Move imgClosedLoop to img_closed_loop. ------------- 0.6.3 diff --git a/python/lsst/ts/imsim/__init__.py b/python/lsst/ts/imsim/__init__.py index e2de311..69cb82a 100644 --- a/python/lsst/ts/imsim/__init__.py +++ b/python/lsst/ts/imsim/__init__.py @@ -19,8 +19,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -from .closedLoopTask import * -from .imsimCmpt import * -from .obsMetadata import * -from .opdMetrology import * -from .skySim import * +from .closed_loop_task import * +from .imsim_cmpt import * +from .obs_metadata import * +from .opd_metrology import * +from .sky_sim import * diff --git a/python/lsst/ts/imsim/closedLoopTask.py b/python/lsst/ts/imsim/closed_loop_task.py similarity index 99% rename from python/lsst/ts/imsim/closedLoopTask.py rename to python/lsst/ts/imsim/closed_loop_task.py index cbb84da..4ef7076 100644 --- a/python/lsst/ts/imsim/closedLoopTask.py +++ b/python/lsst/ts/imsim/closed_loop_task.py @@ -32,10 +32,10 @@ import numpy as np from lsst.afw.cameraGeom import FIELD_ANGLE, DetectorType from lsst.daf import butler as dafButler -from lsst.ts.imsim.imsimCmpt import ImsimCmpt -from lsst.ts.imsim.obsMetadata import ObsMetadata -from lsst.ts.imsim.opdMetrology import OpdMetrology -from lsst.ts.imsim.skySim import SkySim +from lsst.ts.imsim.imsim_cmpt import ImsimCmpt +from lsst.ts.imsim.obs_metadata import ObsMetadata +from lsst.ts.imsim.opd_metrology import OpdMetrology +from lsst.ts.imsim.sky_sim import SkySim from lsst.ts.imsim.utils import ( SensorWavefrontError, get_camera, diff --git a/python/lsst/ts/imsim/imsimCmpt.py b/python/lsst/ts/imsim/imsim_cmpt.py similarity index 99% rename from python/lsst/ts/imsim/imsimCmpt.py rename to python/lsst/ts/imsim/imsim_cmpt.py index 62f2c44..4a846cf 100644 --- a/python/lsst/ts/imsim/imsimCmpt.py +++ b/python/lsst/ts/imsim/imsim_cmpt.py @@ -28,9 +28,9 @@ import yaml from astropy.io import fits from lsst.afw import cameraGeom -from lsst.ts.imsim.obsMetadata import ObsMetadata -from lsst.ts.imsim.opdMetrology import OpdMetrology -from lsst.ts.imsim.skySim import SkySim +from lsst.ts.imsim.obs_metadata import ObsMetadata +from lsst.ts.imsim.opd_metrology import OpdMetrology +from lsst.ts.imsim.sky_sim import SkySim from lsst.ts.imsim.utils import ( ModifiedEnvironment, SensorWavefrontError, diff --git a/python/lsst/ts/imsim/obsMetadata.py b/python/lsst/ts/imsim/obs_metadata.py similarity index 100% rename from python/lsst/ts/imsim/obsMetadata.py rename to python/lsst/ts/imsim/obs_metadata.py diff --git a/python/lsst/ts/imsim/opdMetrology.py b/python/lsst/ts/imsim/opd_metrology.py similarity index 100% rename from python/lsst/ts/imsim/opdMetrology.py rename to python/lsst/ts/imsim/opd_metrology.py diff --git a/python/lsst/ts/imsim/skySim.py b/python/lsst/ts/imsim/sky_sim.py similarity index 99% rename from python/lsst/ts/imsim/skySim.py rename to python/lsst/ts/imsim/sky_sim.py index 8e745f8..73bcc36 100644 --- a/python/lsst/ts/imsim/skySim.py +++ b/python/lsst/ts/imsim/sky_sim.py @@ -24,7 +24,7 @@ import astropy import numpy as np from astroplan import Observer -from lsst.ts.imsim.obsMetadata import ObsMetadata +from lsst.ts.imsim.obs_metadata import ObsMetadata from lsst.ts.imsim.utils import get_camera diff --git a/python/lsst/ts/imsim/utils/__init__.py b/python/lsst/ts/imsim/utils/__init__.py index d5fe6a1..88b9815 100644 --- a/python/lsst/ts/imsim/utils/__init__.py +++ b/python/lsst/ts/imsim/utils/__init__.py @@ -19,7 +19,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -from .metroTool import * -from .plotUtil import * -from .sensorWavefrontError import * +from .metro_tool import * +from .plot_util import * +from .sensor_wavefront_error import * from .utility import * diff --git a/python/lsst/ts/imsim/utils/metroTool.py b/python/lsst/ts/imsim/utils/metro_tool.py similarity index 100% rename from python/lsst/ts/imsim/utils/metroTool.py rename to python/lsst/ts/imsim/utils/metro_tool.py diff --git a/python/lsst/ts/imsim/utils/plotUtil.py b/python/lsst/ts/imsim/utils/plot_util.py similarity index 100% rename from python/lsst/ts/imsim/utils/plotUtil.py rename to python/lsst/ts/imsim/utils/plot_util.py diff --git a/python/lsst/ts/imsim/utils/sensorWavefrontError.py b/python/lsst/ts/imsim/utils/sensor_wavefront_error.py similarity index 100% rename from python/lsst/ts/imsim/utils/sensorWavefrontError.py rename to python/lsst/ts/imsim/utils/sensor_wavefront_error.py diff --git a/tests/test_closedLoopTask.py b/tests/test_closed_loop_task.py similarity index 98% rename from tests/test_closedLoopTask.py rename to tests/test_closed_loop_task.py index 400d045..e7b334f 100644 --- a/tests/test_closedLoopTask.py +++ b/tests/test_closed_loop_task.py @@ -24,8 +24,7 @@ import tempfile import unittest -from lsst.ts.imsim.closedLoopTask import ClosedLoopTask -from lsst.ts.imsim.obsMetadata import ObsMetadata +from lsst.ts.imsim import ClosedLoopTask, ObsMetadata from lsst.ts.imsim.utils.utility import get_module_path from lsst.ts.wep.utils import CamType, FilterType diff --git a/tests/test_imsimCmpt.py b/tests/test_imsim_cmpt.py similarity index 98% rename from tests/test_imsimCmpt.py rename to tests/test_imsim_cmpt.py index 319143e..dfbea0d 100644 --- a/tests/test_imsimCmpt.py +++ b/tests/test_imsim_cmpt.py @@ -26,11 +26,9 @@ import galsim import numpy as np import yaml -from lsst.ts.imsim.imsimCmpt import ImsimCmpt -from lsst.ts.imsim.obsMetadata import ObsMetadata -from lsst.ts.imsim.skySim import SkySim -from lsst.ts.imsim.utils.sensorWavefrontError import SensorWavefrontError -from lsst.ts.imsim.utils.utility import ( +from lsst.ts.imsim import ImsimCmpt, ObsMetadata, SkySim +from lsst.ts.imsim.utils import ( + SensorWavefrontError, get_camera, get_config_dir, get_module_path, diff --git a/tests/test_obsMetadata.py b/tests/test_obs_metadata.py similarity index 97% rename from tests/test_obsMetadata.py rename to tests/test_obs_metadata.py index 36c537c..0efe11d 100644 --- a/tests/test_obsMetadata.py +++ b/tests/test_obs_metadata.py @@ -21,7 +21,7 @@ import unittest -from lsst.ts.imsim.obsMetadata import ObsMetadata +from lsst.ts.imsim import ObsMetadata class TestObsMetadata(unittest.TestCase): diff --git a/tests/test_opdMetrology.py b/tests/test_opd_metrology.py similarity index 99% rename from tests/test_opdMetrology.py rename to tests/test_opd_metrology.py index 5eb96f7..3bd6ffa 100644 --- a/tests/test_opdMetrology.py +++ b/tests/test_opd_metrology.py @@ -26,7 +26,7 @@ import numpy as np from astropy.io import fits from lsst.afw.cameraGeom import FIELD_ANGLE -from lsst.ts.imsim.opdMetrology import OpdMetrology +from lsst.ts.imsim import OpdMetrology from lsst.ts.imsim.utils.utility import get_module_path, get_zk_from_file diff --git a/tests/test_skySim.py b/tests/test_sky_sim.py similarity index 97% rename from tests/test_skySim.py rename to tests/test_sky_sim.py index cc12e3d..fa6b4f4 100644 --- a/tests/test_skySim.py +++ b/tests/test_sky_sim.py @@ -24,8 +24,7 @@ from astroplan import FixedTarget, Observer from astropy.time import Time -from lsst.ts.imsim.obsMetadata import ObsMetadata -from lsst.ts.imsim.skySim import SkySim +from lsst.ts.imsim import ObsMetadata, SkySim from lsst.ts.imsim.utils.utility import get_module_path diff --git a/tests/utils/test_plotUtil.py b/tests/utils/test_plot_util.py similarity index 94% rename from tests/utils/test_plotUtil.py rename to tests/utils/test_plot_util.py index 9b1653a..28bbe06 100644 --- a/tests/utils/test_plotUtil.py +++ b/tests/utils/test_plot_util.py @@ -22,8 +22,7 @@ import os import unittest -from lsst.ts.imsim.utils.plotUtil import plot_fwhm_of_iters -from lsst.ts.imsim.utils.utility import get_module_path +from lsst.ts.imsim.utils import get_module_path, plot_fwhm_of_iters class TestPlotUtil(unittest.TestCase): diff --git a/tests/utils/test_sensorWavefrontError.py b/tests/utils/test_sensor_wavefront_error.py similarity index 98% rename from tests/utils/test_sensorWavefrontError.py rename to tests/utils/test_sensor_wavefront_error.py index aadcdd7..b713c14 100644 --- a/tests/utils/test_sensorWavefrontError.py +++ b/tests/utils/test_sensor_wavefront_error.py @@ -22,7 +22,7 @@ import unittest import numpy as np -from lsst.ts.imsim.utils.sensorWavefrontError import SensorWavefrontError +from lsst.ts.imsim.utils import SensorWavefrontError class TestSensorWavefrontError(unittest.TestCase): diff --git a/tests/utils/test_utility.py b/tests/utils/test_utility.py index 03fd19a..fb8c33c 100644 --- a/tests/utils/test_utility.py +++ b/tests/utils/test_utility.py @@ -24,7 +24,7 @@ from lsst.afw import cameraGeom from lsst.obs.lsst import LsstCam -from lsst.ts.imsim.utils.utility import ( +from lsst.ts.imsim.utils import ( ModifiedEnvironment, get_camera, get_config_dir,