Skip to content

Commit

Permalink
Merge pull request #15 from openweathermap/fix/description_and_traces
Browse files Browse the repository at this point in the history
Fix/description and traces
  • Loading branch information
SerGeRybakov authored Aug 30, 2023
2 parents 2460e43 + ea0603e commit 77e470a
Show file tree
Hide file tree
Showing 8 changed files with 169 additions and 142 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/manual.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: manual_docs

on:
workflow_dispatch:

jobs:
build_docs:
if: ${{ github.ref == 'refs/heads/main'}}
uses: openweathermap/deker-actions/.github/workflows/docs_build.yml@master
with:
python-version: '3.9'

publish_docs:
needs: build_docs
uses: openweathermap/deker-actions/.github/workflows/docs_publish.yml@master
7 changes: 5 additions & 2 deletions deker/ABC/base_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,11 @@ def __del__(self) -> None:
@abstractmethod
def close(self) -> None:
"""Close own executor."""
if self.executor and self._own_executor:
self.executor.shutdown(wait=True, cancel_futures=False)
try:
if self.executor and self._own_executor:
self.executor.shutdown(wait=True, cancel_futures=False)
except AttributeError:
pass

@abstractmethod
def get_array_adapter(self, *args: Any, **kwargs: Any) -> "BaseArrayAdapter":
Expand Down
2 changes: 1 addition & 1 deletion deker/ABC/base_subset.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def __generate_full_scale(dimension: Dimension) -> List:
step = dimension.scale.step
start_value = dimension.scale.start_value
end = start_value + dimension.size * step
rounder = len(str(start_value).split(".")[-1])
rounder = len(str(step).split(".")[-1])
value = np.around(np.arange(start_value, end, dimension.scale.step), rounder)
return value.tolist()[: dimension.size] # type: ignore[return-value]

Expand Down
23 changes: 14 additions & 9 deletions deker/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,15 +330,20 @@ def calculate_storage_size(self, collection_name: str = "") -> StorageSize:

def close(self) -> None:
"""Close client."""
if self.__adapter:
self.__adapter.close()
self.__adapter = None
if self.__factory:
self.__factory.close()
self.__factory = None
self.__is_closed = True
self.__ctx.is_closed = True
self.logger.info("Client is closed")
try:
if self.__adapter:
self.__adapter.close()
self.__adapter = None
if self.__factory:
self.__factory.close()
self.__factory = None
if self.__ctx:
self.__ctx.is_closed = True
self.__is_closed = True
except AttributeError as e:
self.logger.debug(f"Exception in Client.close(): {e}")
finally:
self.logger.info("Client is closed")

def create_collection(
self,
Expand Down
4 changes: 2 additions & 2 deletions docs/deker/connecting_to_server.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ By default, adapters' ``httpx client`` has following settings:
- True
* - http2
- bool
- True
- False
* - timeout
- Optional[float]
- Optional[int, float]
- None

The full list of ``httpx`` configuration parameters you can find at `the official website`_.
Expand Down
8 changes: 6 additions & 2 deletions docs/deker/shell.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ line parameter (in this case it would be ``/tmp/deker-data``)::

deker file:///tmp/deker-data


Examples
========

Expand All @@ -46,7 +45,6 @@ REPL menu (called with ``F2``):
.. image:: images/shell_menu.png
:scale: 45%


Interface
=========

Expand Down Expand Up @@ -91,3 +89,9 @@ Functions

* ``use("collection_name")``: gets collection from client and saves it to ``collection`` variable
* ``get_global_coll_variable()``: returns ``collection`` global variable

Miscellaneous
--------------
You can also run an isolated Python script with::

deker my_python_script.py
Loading

0 comments on commit 77e470a

Please sign in to comment.