Skip to content

Commit

Permalink
Merge pull request #302 from macro-consortium/wwg-dev
Browse files Browse the repository at this point in the history
Merge wwg-dev with RLMT hotfixes into RLMT hotfixes
  • Loading branch information
pgriffin17 authored Dec 30, 2024
2 parents 0b67d98 + 7c9e156 commit 7cc0500
Show file tree
Hide file tree
Showing 105 changed files with 4,722 additions and 979 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ jobs:
- name: Build package
run: python -m build
- name: pypi-publish
uses: pypa/gh-action-pypi-publish@v1.11.0
uses: pypa/gh-action-pypi-publish@v1.12.2
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v5.0.0
hooks:
- id: check-ast
- id: check-case-conflict
Expand All @@ -14,7 +14,7 @@ repos:
- id: isort
args: [--profile=black]
- repo: https://github.com/psf/black
rev: 24.3.0
rev: 24.10.0
hooks:
- id: black
- repo: https://github.com/pre-commit/pygrep-hooks
Expand Down
1 change: 1 addition & 0 deletions docs/source/api/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ API Reference
:maxdepth: 3

observatory
scheduling
telrun
reduction
analysis
Expand Down
22 changes: 22 additions & 0 deletions docs/source/api/scheduling.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
scheduling Module
===================

.. automodule:: pyscope.scheduling

Classes
-------
.. automodsumm:: pyscope.scheduling
:classes-only:
:toctree: .

Functions
---------
.. automodsumm:: pyscope.scheduling
:functions-only:
:toctree: .

Variables
---------------
.. automodsumm:: pyscope.scheduling
:variables-only:
:toctree: .
2 changes: 1 addition & 1 deletion pyscope/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,4 @@
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)

__all__ = ["analysis", "observatory", "reduction", "telrun", "utils"]
__all__ = ["analysis", "observatory", "reduction", "scheduling", "telrun", "utils"]
3 changes: 3 additions & 0 deletions pyscope/bin/scripts/start_sync_manager
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/home/$USER/anaconda3/python

start_syncfiles
33 changes: 33 additions & 0 deletions pyscope/bin/scripts/start_sync_manager.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
@echo OFF
rem How to run a Python script in a given conda environment from a batch file.

rem It doesn't require:
rem - conda to be in the PATH
rem - cmd.exe to be initialized with conda init

rem Define here the path to your conda installation
set CONDAPATH=C:\Users\%USERNAME%\Anaconda3\
rem Define here the name of the environment
set ENVNAME=base

rem The following command activates the base environment.
rem call C:\ProgramData\Miniconda3\Scripts\activate.bat C:\ProgramData\Miniconda3
if %ENVNAME%==base (set ENVPATH=%CONDAPATH%) else (set ENVPATH=%CONDAPATH%\envs\%ENVNAME%)

rem Activate the conda environment
rem Using call is required here, see: https://stackoverflow.com/questions/24678144/conda-environments-and-bat-files
call %CONDAPATH%\Scripts\activate.bat %ENVPATH%

rem Run a python script in that environment
python start_syncfiles

rem Deactivate the environment
call conda deactivate

rem If conda is directly available from the command line then the following code works.
rem call activate someenv
rem python script.py
rem conda deactivate

rem One could also use the conda run command
rem conda run -n someenv python script.py
3 changes: 3 additions & 0 deletions pyscope/bin/scripts/start_telrun
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/home/$USER/anaconda3/python

start_telrun
33 changes: 33 additions & 0 deletions pyscope/bin/scripts/start_telrun.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
@echo OFF
rem How to run a Python script in a given conda environment from a batch file.

rem It doesn't require:
rem - conda to be in the PATH
rem - cmd.exe to be initialized with conda init

rem Define here the path to your conda installation
set CONDAPATH=C:\Users\%USERNAME%\Anaconda3\
rem Define here the name of the environment
set ENVNAME=base

rem The following command activates the base environment.
rem call C:\ProgramData\Miniconda3\Scripts\activate.bat C:\ProgramData\Miniconda3
if %ENVNAME%==base (set ENVPATH=%CONDAPATH%) else (set ENVPATH=%CONDAPATH%\envs\%ENVNAME%)

rem Activate the conda environment
rem Using call is required here, see: https://stackoverflow.com/questions/24678144/conda-environments-and-bat-files
call %CONDAPATH%\Scripts\activate.bat %ENVPATH%

rem Run a python script in that environment
python start_telrun

rem Deactivate the environment
call conda deactivate

rem If conda is directly available from the command line then the following code works.
rem call activate someenv
rem python script.py
rem conda deactivate

rem One could also use the conda run command
rem conda run -n someenv python script.py
3 changes: 2 additions & 1 deletion pyscope/observatory/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,10 @@
from .observatory_exception import ObservatoryException
from .observatory import Observatory


from .pwi_autofocus import PWIAutofocus

from .zwo_camera import ZWOCamera

# from .skyx import SkyX

from .collect_calibration_set import collect_calibration_set
Expand Down
14 changes: 10 additions & 4 deletions pyscope/observatory/_pwi4.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,17 @@


class _PWI4:
"""
Client to the PWI4 telescope control application.
"""

def __init__(self, host="localhost", port=8220):
"""
Client to the PWI4 telescope control application.
Parameters
----------
host : `str`, default : "localhost", optional
The hostname or IP address of the computer running PWI4.
port : `int`, default : 8220, optional
The port number on which PWI4 is listening for HTTP requests.
"""
self.host = host
self.port = port
self.comm = _PWI4HttpCommunicator(host, port)
Expand Down
Loading

0 comments on commit 7cc0500

Please sign in to comment.