Skip to content

Commit

Permalink
Rename cache_folder to locate (#13)
Browse files Browse the repository at this point in the history
This is more compatible with the current functions in the package
datasets modules. Do this now before a release to avoid deprecation
cycles later.
  • Loading branch information
leouieda authored Dec 23, 2021
1 parent 12c2774 commit 88c3988
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion doc/api/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Functions:
.. autosummary::
:toctree: generated/

ensaio.v1.cache_folder
ensaio.v1.locate
ensaio.v1.fetch_alps_gps
ensaio.v1.fetch_britain_magnetic
ensaio.v1.fetch_british_columbia_lidar
Expand Down
4 changes: 2 additions & 2 deletions doc/tutorial_src/using.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@
# -------------------
#
# The location of the cache folder varies by operating system. Use the
# :func:`ensaio.v1.cache_folder` function to get its location on your computer.
print(ensaio.cache_folder())
# :func:`ensaio.v1.locate` function to get its location on your computer.
print(ensaio.locate())

###############################################################################
# You can also set the location manually by creating a ``ENSAIO_V1_DATA_DIR``
Expand Down
4 changes: 2 additions & 2 deletions ensaio/tests/test_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ def test_v1_fetch_datasets(fetch):
assert path.exists()


def test_v1_cache_folder():
def test_v1_locate():
"Check that the cache folder exists by default after a fetch call"
FETCH_FUNCTIONS[0]()
path = v1.cache_folder()
path = v1.locate()
assert path.exists()
6 changes: 3 additions & 3 deletions ensaio/v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ def _repository():
return repository


def cache_folder():
def locate():
"""
The location of the data cache for v1 datasets
Return the location of the system-dependent data cache for v1 datasets
This folder is not guaranteed to exist in the file system until a dataset
has been downloaded.
Expand All @@ -66,7 +66,7 @@ def cache_folder():
Returns
-------
cache : :class:`pathlib.Path`
path : :class:`pathlib.Path`
Path to the cache folder.
"""
return _repository().abspath
Expand Down

0 comments on commit 88c3988

Please sign in to comment.