Skip to content

Commit

Permalink
Remove tests-based code example from walkthrough. More precise requir…
Browse files Browse the repository at this point in the history
…ements, back to python 3.9 importlib.resources
  • Loading branch information
dr-leo committed Feb 25, 2023
1 parent 2aca903 commit c72224e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 12 deletions.
3 changes: 2 additions & 1 deletion doc/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
lxml=4.9.2
requests==2.28
requests==2.28.1
requests-cache==0.9.7
pandas==1.5.2
sphinx==5.3
ipython==8.7.0
Expand Down
11 changes: 2 additions & 9 deletions doc/walkthrough.rst
Original file line number Diff line number Diff line change
Expand Up @@ -555,15 +555,8 @@ e.g., to access a cloud storage provider's file system.

Likewise, :func:`.read_sdmx` can be used
to load SDMX messages stored in local files or
remote files using FSSPEC:

.. ipython:: python
# Use an example ('specimen') file from the pandaSDMX test suite
from pandasdmx.tests.data import specimen
# …with time-series exchange rate data from the EU Central Bank
with specimen('ECB_EXR/ng-ts.xml') as f:
sdmx.read_sdmx(f)
remote files using
`FSSPEC <https://filesystem-spec.readthedocs.io/en/latest/>`__.


Handle errors
Expand Down
3 changes: 1 addition & 2 deletions pandasdmx/source/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,7 @@ def list_sources():

def load_package_sources():
"""Discover all sources listed in ``sources.json``."""
# py3.9+: with resources.files("pandasdmx").joinpath("sources.json").open("rb") as f:
with resources.open_binary("pandasdmx", "sources.json") as f:
with resources.files("pandasdmx").joinpath("sources.json").open("rb") as f:
for info in json.load(f):
add_source(info)

Expand Down

0 comments on commit c72224e

Please sign in to comment.