Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update default hed_cache location/tweak readme #520

Merged
merged 1 commit into from
Jul 1, 2022
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
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,11 @@ The [Github pull request](https://github.com/hed-standard/hed-python/pulls)
may also be used for contributions.
Usually these updates should be made to the `develop` branch, not the `master`.

### Support for earlier versions of HED (HED-2G)

**Note:** As of January 1, 2022, the `hed-python` repository will no longer support HED-2G.
The existing support continues to be available in the `hed2-python` repository.
An on online version of the HED-2G tools are available at
[https://hedtools.ucsd.edu/hed2](https://hedtools.ucsd.edu/hed2)
#### Local Settings Storage
Cached Schemas by default are stored in "home/.hedtools/"
Location of "home" directory varies by OS.

Use hed.schema.set_cache_directory to change the location.

### Other links of interest

Expand Down
7 changes: 3 additions & 4 deletions hed/schema/hed_cache.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" Infrastructure for caching HED schema. """
"""Infrastructure for caching HED schema from remote repositories."""

import os
import urllib.request
Expand All @@ -11,8 +11,7 @@
import portalocker
import time
from hed.schema.schema_io.schema_util import url_to_file

"""Infrastructure for caching HED schema from remote repositories."""
from pathlib import Path

# From https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string
HED_VERSION_P1 = r"(?P<major>0|[1-9]\d*)\.(?P<minor>0|[1-9]\d*)\.(?P<patch>0|[1-9]\d*)"
Expand All @@ -33,7 +32,7 @@

DEFAULT_SKIP_FOLDERS = ('deprecated', )

HED_CACHE_DIRECTORY = os.path.join(os.path.dirname(os.path.realpath(__file__)), '../validator/hed_cache/')
HED_CACHE_DIRECTORY = os.path.join(Path.home(), '.hedtools/hed_cache/')
TIMESTAMP_FILENAME = "last_update.txt"
CACHE_TIME_THRESHOLD = 300 * 6

Expand Down