Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.9", "3.10", "3.11"]
python-version: ["3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v2
Expand All @@ -38,4 +38,4 @@ jobs:

- name: Test doc build with tox
run: tox -e docs
if: ${{ (matrix.python-version == '3.10') && (matrix.os == 'ubuntu-latest')}}
if: ${{ (matrix.python-version == '3.11') && (matrix.os == 'ubuntu-latest')}}
4 changes: 2 additions & 2 deletions .github/workflows/deploy_public.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Set up Python 3.10
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: "3.11"

- name: Install dependencies
run: |
Expand Down
1 change: 1 addition & 0 deletions datareservoirio/appdirs.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
https://github.com/pypa/pip/blob/master/src/pip/_internal/utils/appdirs.py and
modified to suit our purposes.
"""

from __future__ import absolute_import, division, print_function

import os
Expand Down
14 changes: 9 additions & 5 deletions datareservoirio/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,9 @@ def get_samples_aggregate_page(url):
timeout=_TIMEOUT_DEAULT,
)

progress_bar = tqdm(unit=" pages", desc="Downloading aggregate data")
if log.getEffectiveLevel() < logging.WARNING:
progress_bar = tqdm(unit=" pages", desc="Downloading aggregate data")

while next_page_link:
response = get_samples_aggregate_page(next_page_link)
response.raise_for_status()
Expand All @@ -559,17 +561,19 @@ def get_samples_aggregate_page(url):
]

# update the progress bar
if content:
if content and log.getEffectiveLevel() < logging.WARNING:
progress_bar.update(1)

new_df = pd.DataFrame(
content, columns=("index", "values"), copy=False
).astype({"values": "float64"}, errors="ignore")

df = pd.concat([df, new_df])

progress_bar.close()
series = df.set_index("index").squeeze("columns").copy(deep=True)
if log.getEffectiveLevel() < logging.WARNING:
progress_bar.close()
series = (
df.infer_objects().set_index("index").squeeze("columns").copy(deep=True)
)

return series

Expand Down
5 changes: 4 additions & 1 deletion docs/user_guide/advanced_config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,10 @@ Logging
To simplify debugging, enable logging for the logger named 'datareservoirio'. This is especially helpful if you experience undesired behavior in your application.

If your logging requirements are solely related to :py:mod:`datareservoirio`, you can use the following code. This will provide you with an understanding of the progress made in some
of the processes in the package. It is recommended to use this logging.
of the processes in the package.
In particular, when using :py:meth:`Client.get_samples_aggregate`, lowering the log level below WARNING triggers a progress bar during data collection.
The default log level for the logger named 'datareservoirio' is WARNING.
It is recommended to use this logging.

.. code-block:: python

Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ dynamic = ["version"]
description = "DataReservoir.io Python API"
readme = "README.rst"
license = { file="LICENSE" }
requires-python = ">3.9"
requires-python = ">3.10"
classifiers = [
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
dependencies = [
"numpy",
Expand Down Expand Up @@ -69,7 +69,7 @@ deps =


[testenv:docs]
basepython = python3.10
basepython = python3.11
commands = sphinx-build -W -b html -d {toxworkdir}/docs_doctree docs {toxworkdir}/docs_out
deps =
sphinx==5.3.0
Expand Down
1 change: 1 addition & 0 deletions tests/response_cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
Note that ``url`` is defined as part of the key in RESPONSE_CASES.
See ``requests.Response`` source code for more details.
"""

from pathlib import Path

TEST_PATH = Path(__file__).parent
Expand Down