diff --git a/CHANGES.rst b/CHANGES.rst new file mode 100644 index 0000000..44a767a --- /dev/null +++ b/CHANGES.rst @@ -0,0 +1,14 @@ +Version 2.0.1-rc1 (2022-07-17) +============================== + +- Release candidate. + +Changes since 2.0.0-dev2 +------------------------ + +- Improve speed via re-use of sockets (Connection: keep-alive) for device HTTP. +- ObservingConditions.SensorDescription() has been fixed to accept the sensor name +- Parameters for ObservingConditions.TimeSinceLastUpdate() and + ObservingConditions.SensorDescription() have been corrected to SensorName. +- Correct ObservingConditions.AveragePeriod to remove capital P from URI + diff --git a/README.md b/README.md index b67e622..006a969 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# alpyca (2.0.0-dev2) +# alpyca (2.0.1rc1) ## Python 3.7+ API library for all [ASCOM Alpaca](https://ascom-standards.org/Developer/Alpaca.htm) universal interfaces @@ -6,7 +6,7 @@ Produced by the [ASCOM Initiative](https://ascom-standards.org/), and derived from Ethan Chappel's Alpyca 1.0.0. Ethan kindly released the name **Alpyca** to the ASCOM Initiative, hence this expanded -package starts life as Version 2.0.0-dev2. +package starts life as Version 2.0. ## Requirements @@ -35,10 +35,11 @@ The dependencies listed above are automatically installed with alpyca. ## Current Status & Documentation -This version 2.0.0-dev2 is a developmental/alpha release. The documentation is +This version 2.0.1rc1 is the first release candidate for 2.0.1. The documentation is extensive and available online as **[Alpyca: API Library for Alpaca](https://ascom-standards.org/alpyca/)** as well as a -**[PDF Document here](https://ascom-standards.org/alpyca/alpyca.pdf)**. +**[PDF Document here](https://ascom-standards.org/alpyca/alpyca.pdf)**. See CHANGES.rst for +change log. ## Feedback and Discussion diff --git a/alpaca/__init__.py b/alpaca/__init__.py index a730725..8b13789 100644 --- a/alpaca/__init__.py +++ b/alpaca/__init__.py @@ -1 +1 @@ -"""This is under development""" + diff --git a/alpaca/device.py b/alpaca/device.py index ee24f36..4d837b5 100644 --- a/alpaca/device.py +++ b/alpaca/device.py @@ -38,6 +38,7 @@ # 02-May-22 (rbd) Initial Edit # 03-May-22 (rbd) Fix DriverException wording to final agreed text. # 13-May-22 (rbd) 2.0.0-dev1 Project now called "Alpyca" - no logic changes +# 17-Jul-22 (rbd) 2.0.1rc1 Speed up by re-using ports via requests.Session(). # ----------------------------------------------------------------------------- from threading import Lock @@ -85,6 +86,8 @@ def __init__( self.device_type, self.device_number ) + self.rqs = requests.Session() + # ------------------------------------------------ # CLASS VARIABLES - SHARED ACROSS DEVICE INSTANCES # ------------------------------------------------ @@ -376,7 +379,7 @@ def _get(self, attribute: str, tmo=5.0, **data) -> str: # TODO - Catch and handle connect failures nicely try: Device._ctid_lock.acquire() - response = requests.get("%s/%s" % (self.base_url, attribute), + response = self.rqs.get("%s/%s" % (self.base_url, attribute), params=pdata, timeout=tmo, headers=hdrs) Device._client_trans_id += 1 finally: @@ -406,7 +409,7 @@ def _put(self, attribute: str, tmo=5.0, **data) -> str: # TODO - Catch and handle connect failures nicely try: Device._ctid_lock.acquire() - response = requests.put("%s/%s" % (self.base_url, attribute), + response = self.rqs.put("%s/%s" % (self.base_url, attribute), data=pdata, timeout=tmo, headers=hdrs) Device._client_trans_id += 1 finally: @@ -414,7 +417,7 @@ def _put(self, attribute: str, tmo=5.0, **data) -> str: self.__check_error(response) return response.json() # TODO Is this right? json()? - def __check_error(self, response: requests.Response) -> None: + def __check_error(self, response) -> None: """Alpaca exception handler (ASCOM exception types) Args: diff --git a/docs/source/conf.py b/docs/source/conf.py index 19ec179..8714264 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -105,7 +105,7 @@ rinoh_documents = [dict(doc='index', # top-level file (index.rst) target='alpyca', # output file (alpyca.pdf) title='Alpyca Library', - subtitle='Release 2.0.0-dev2', + subtitle='Release 2.0.1rc1', author='Robert B. Denny ', logo='alpaca1000.png', template='alpyca.rtt')] diff --git a/docs/source/index.rst b/docs/source/index.rst index a03a7f1..7c9220a 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -13,20 +13,23 @@ :width: 128px :align: right - ================= - Welcome to Alpyca - ================= + ===================== + Welcome to Alpyca 2.0 + ===================== .. only:: rinoh or rst - ================= - Welcome to Alpyca - ================= + ===================== + Welcome to Alpyca 2.0 + ===================== -This document describes the Alpyca package, a Python API Library for ASCOM Alpaca. -The package provides all of the ASCOM Standard -universal interfaces to astronomical devices using the Alpaca network protocol. As an application developer, your -usage of the various devices is simplified and universal, independent of the particular make/model of device. +This document describes the Alpyca package, a Python API client library for ASCOM Alpaca, produced by the +ASCOM Initiative, and derived from Ethan Chappel's Alpyca 1.0.0. Ethan kindly released the name +**Alpyca** to the ASCOM Initiative, hence this expanded package starts life as Version 2.0. + +The package provides all of the ASCOM Standard universal interfaces to astronomical devices using the +Alpaca network protocol. As an application developer, your usage of the various devices is simplified +and universal, independent of the particular make/model of device. .. only:: html diff --git a/pyproject.toml b/pyproject.toml index 14951d2..c37721b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "alpyca" -version = "2.0.0-dev2" +version = "2.0.1-pre.1" # Becomes 2.0.1rc1 description = "API library for all ASCOM Alpaca devices, management, and discovery" authors = ["Robert B. Denny "] license = "LICENSE"