Skip to content

Commit

Permalink
Merge branch 'wwg-dev' of https://github.com/WWGolay/pyscope into wwg…
Browse files Browse the repository at this point in the history
…-dev
  • Loading branch information
WWGolay committed Dec 20, 2024
2 parents 6380970 + 8861d38 commit f84d2d8
Show file tree
Hide file tree
Showing 27 changed files with 1,292 additions and 52 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
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
1 change: 1 addition & 0 deletions pyscope/observatory/ascom_camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,7 @@ def LastExposureStartTime(self):

@property
def LastInputExposureDuration(self):
"""The duration of the last exposure in seconds. (`float`)"""
logger.debug(f"ASCOMCamera.LastInputExposureDuration property called")
return self._last_exposure_duration

Expand Down
17 changes: 17 additions & 0 deletions pyscope/observatory/ascom_rotator.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,23 @@

class ASCOMRotator(ASCOMDevice, Rotator):
def __init__(self, identifier, alpaca=False, device_number=0, protocol="http"):
"""
ASCOM implementation of the Rotator base class.
The class provides an interface to control an ASCOM-compatible rotator device, including methods for
moving, halting, and properties for determining the current position and movement state of the rotator.
Parameters
----------
identifier : `str`
The device identifier.
alpaca : `bool`, default : `False`, optional
Whether the device is an Alpaca device.
device_number : `int`, default : 0, optional
The device number.
protocol : `str`, default : "http", optional
The protocol to use for communication with the device.
"""
super().__init__(
identifier,
alpaca=alpaca,
Expand Down
19 changes: 19 additions & 0 deletions pyscope/observatory/ascom_safety_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,25 @@

class ASCOMSafetyMonitor(ASCOMDevice, SafetyMonitor):
def __init__(self, identifier, alpaca=False, device_number=0, protocol="http"):
"""
ASCOM implementation of the SafetyMonitor base class.
This class provides an interface to ASCOM-compatible safety monitors,
allowing the observatory to check if weather, power, and other
observatory-specific conditions allow safe usage of observatory equipment,
such as opening the roof or dome.
Parameters
----------
identifier : `str`
The device identifier.
alpaca : `bool`, default : `False`, optional
Whether the device is an Alpaca device.
device_number : `int`, default : 0, optional
The device number.
protocol : `str`, default : "http", optional
The device communication protocol.
"""
super().__init__(
identifier,
alpaca=alpaca,
Expand Down
17 changes: 17 additions & 0 deletions pyscope/observatory/ascom_switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,23 @@

class ASCOMSwitch(ASCOMDevice, Switch):
def __init__(self, identifier, alpaca=False, device_number=0, protocol="http"):
"""
ASCOM implementation of the Switch base class.
The class provides an interface to ASCOM-compatible switch devices, including methods for
getting and setting switch values, and getting switch names and descriptions.
Parameters
----------
identifier : `str`
The device identifier.
alpaca : `bool`, default : `False`, optional
Whether the device is an Alpaca device.
device_number : `int`, default : 0, optional
The device number.
protocol : `str`, default : "http", optional
The protocol to use for communication with the device.
"""
super().__init__(
identifier,
alpaca=alpaca,
Expand Down
Loading

0 comments on commit f84d2d8

Please sign in to comment.