Skip to content

Commit 22443ce

Browse files
Merge branch 'main' into fix_mask_equal_2
2 parents 3453b21 + 166d0b4 commit 22443ce

18 files changed

+246
-95
lines changed

.github/dependabot.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
5+
6+
version: 2
7+
updates:
8+
# Enable version updates for GitHub Actions
9+
- package-ecosystem: "github-actions"
10+
# Workflow files stored in the default location of `.github/workflows`
11+
# You don't need to specify `/.github/workflows` for `directory`. You can use `directory: "/"`.
12+
directory: "/"
13+
schedule:
14+
interval: "weekly"
15+
cooldown:
16+
default-days: 7
17+
labels:
18+
- dependencies
19+
- github_actions
20+
- automatedPR

.github/workflows/build-and-deploy-on-pypi.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ jobs:
1616
# IMPORTANT: this permission is mandatory for trusted publishing on PyPI or Test PyPI
1717
id-token: write
1818
steps:
19-
- uses: actions/checkout@v5
19+
- uses: actions/checkout@v6
2020
with:
2121
fetch-depth: 0
2222
- name: Set up Python 3.14
23-
uses: actions/setup-python@v4
23+
uses: actions/setup-python@v6
2424
with:
2525
python-version: "3.14"
2626
- name: Install pep517

.github/workflows/create-condalock-file.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
name: Create and verify conda lock file for latest Python
2121
runs-on: 'ubuntu-latest'
2222
steps:
23-
- uses: actions/checkout@v5
23+
- uses: actions/checkout@v6
2424
with:
2525
fetch-depth: 0
2626
- uses: conda-incubator/setup-miniconda@v3
@@ -64,7 +64,7 @@ jobs:
6464
# Automated PR
6565
# see https://github.com/marketplace/actions/create-pull-request
6666
- name: Create Automated PR if conda lock file has changed
67-
uses: peter-evans/create-pull-request@v3
67+
uses: peter-evans/create-pull-request@v8
6868
with:
6969
token: ${{ secrets.GITHUB_TOKEN }}
7070
commit-message: Updating condalock file

.github/workflows/install-from-condalock-file.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
fail-fast: false
2626
name: Linux Python ${{ matrix.python-version }}
2727
steps:
28-
- uses: actions/checkout@v5
28+
- uses: actions/checkout@v6
2929
with:
3030
fetch-depth: 0
3131
- uses: conda-incubator/setup-miniconda@v3

.github/workflows/run-s3-test-push.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
fail-fast: false
2020
name: Linux Python ${{ matrix.python-version }}
2121
steps:
22-
- uses: actions/checkout@v5
22+
- uses: actions/checkout@v6
2323
with:
2424
fetch-depth: 0
2525
- name: Export proxy

.github/workflows/run-test-push.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
fail-fast: false
1818
name: Linux Python ${{ matrix.python-version }}
1919
steps:
20-
- uses: actions/checkout@v5
20+
- uses: actions/checkout@v6
2121
with:
2222
fetch-depth: 0
2323
- uses: conda-incubator/setup-miniconda@v3
@@ -33,4 +33,4 @@ jobs:
3333
- run: conda list
3434
- run: flake8 --exclude tests,doc --max-line-length 120 --ignore F405,F401
3535
- run: pytest -n 2 -m "not slow" --junitxml=report-1.xml
36-
- uses: codecov/codecov-action@v5
36+
- uses: codecov/codecov-action@v6

.github/workflows/run-tests-condaforge.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
fail-fast: false
2222
name: Linux Python ${{ matrix.python-version }}
2323
steps:
24-
- uses: actions/checkout@v5
24+
- uses: actions/checkout@v6
2525
with:
2626
fetch-depth: 0
2727
- uses: conda-incubator/setup-miniconda@v3
@@ -54,7 +54,7 @@ jobs:
5454
fail-fast: false
5555
name: OSX Python ${{ matrix.python-version }}
5656
steps:
57-
- uses: actions/checkout@v5
57+
- uses: actions/checkout@v6
5858
with:
5959
fetch-depth: 0
6060
- uses: conda-incubator/setup-miniconda@v3

.github/workflows/run-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
fail-fast: false
2222
name: Linux Python ${{ matrix.python-version }}
2323
steps:
24-
- uses: actions/checkout@v5
24+
- uses: actions/checkout@v6
2525
with:
2626
fetch-depth: 0
2727
- uses: conda-incubator/setup-miniconda@v3
@@ -46,7 +46,7 @@ jobs:
4646
fail-fast: false
4747
name: OSX Python ${{ matrix.python-version }}
4848
steps:
49-
- uses: actions/checkout@v5
49+
- uses: actions/checkout@v6
5050
with:
5151
fetch-depth: 0
5252
- uses: conda-incubator/setup-miniconda@v3

.github/workflows/test_s3_minio.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
fail-fast: false
2424
name: Linux Python ${{ matrix.python-version }}
2525
steps:
26-
- uses: actions/checkout@v5
26+
- uses: actions/checkout@v6
2727
with:
2828
fetch-depth: 0
2929
- name: Export proxy

activestorage/active.py

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,8 @@ def __init__(self,
191191
interface_type: str = None,
192192
max_threads: int = 100,
193193
storage_options: dict = None,
194-
active_storage_url: str = None) -> None:
194+
active_storage_url: str = None,
195+
option_disable_chunk_cache: bool = False) -> None:
195196
"""
196197
Instantiate with a NetCDF4 dataset URI and the variable of interest within that file.
197198
(We need the variable, because we need variable specific metadata from within that
@@ -200,6 +201,7 @@ def __init__(self,
200201
201202
:param storage_options: s3fs.S3FileSystem options
202203
:param active_storage_url: Reductionist server URL
204+
:param option_disable_chunk_cache: flag to disable chunk caching
203205
"""
204206
self.ds = None
205207
input_variable = False
@@ -257,6 +259,9 @@ def __init__(self,
257259
self.storage_options = storage_options
258260
self.active_storage_url = active_storage_url
259261

262+
# turn off chunk caching
263+
self.option_disable_chunk_cache = option_disable_chunk_cache
264+
260265
# basic check on file
261266
if not input_variable:
262267
if not os.path.isfile(self.uri) and not self.interface_type:
@@ -515,21 +520,22 @@ def _from_storage(self, ds, indexer, chunks, out_shape, out_dtype,
515520
# Create a shared session object.
516521
if self.interface_type == "s3" and self._version == 2:
517522
if self.storage_options is not None:
518-
key, secret = None, None
519523
if self.storage_options.get("anon", None) is True:
520524
print("Reductionist session for Anon S3 bucket.")
521525
session = reductionist.get_session(
522526
None, None, S3_ACTIVE_STORAGE_CACERT)
523-
if "key" in self.storage_options:
524-
key = self.storage_options["key"]
525-
if "secret" in self.storage_options:
526-
secret = self.storage_options["secret"]
527-
if key and secret:
528-
session = reductionist.get_session(
529-
key, secret, S3_ACTIVE_STORAGE_CACERT)
530527
else:
531-
session = reductionist.get_session(
532-
S3_ACCESS_KEY, S3_SECRET_KEY, S3_ACTIVE_STORAGE_CACERT)
528+
key, secret = None, None
529+
if "key" in self.storage_options:
530+
key = self.storage_options["key"]
531+
if "secret" in self.storage_options:
532+
secret = self.storage_options["secret"]
533+
if key and secret:
534+
session = reductionist.get_session(
535+
key, secret, S3_ACTIVE_STORAGE_CACERT)
536+
else:
537+
session = reductionist.get_session(
538+
S3_ACCESS_KEY, S3_SECRET_KEY, S3_ACTIVE_STORAGE_CACERT)
533539
else:
534540
session = reductionist.get_session(S3_ACCESS_KEY,
535541
S3_SECRET_KEY,
@@ -661,6 +667,9 @@ def _process_chunk(self,
661667
# Axes over which to apply a reduction
662668
axis = self._axis
663669

670+
# turn off chunk caching
671+
chunk_caching = self.option_disable_chunk_cache
672+
664673
if self.interface_type == 's3' and self._version == 1:
665674
tmp, count = reduce_opens3_chunk(ds._fh,
666675
offset,
@@ -703,7 +712,8 @@ def _process_chunk(self,
703712
ds._order,
704713
chunk_selection,
705714
axis,
706-
operation=self._method)
715+
operation=self._method,
716+
option_disable_chunk_cache=chunk_caching,)
707717
else:
708718
if self.storage_options.get("anon", None) is True:
709719
bucket = os.path.dirname(parsed_url.path)
@@ -723,7 +733,8 @@ def _process_chunk(self,
723733
ds._order,
724734
chunk_selection,
725735
axis,
726-
operation=self._method)
736+
operation=self._method,
737+
option_disable_chunk_cache=chunk_caching,)
727738
elif self.interface_type == "https" and self._version == 2:
728739
tmp, count = reductionist.reduce_chunk(session,
729740
self.active_storage_url,
@@ -739,7 +750,8 @@ def _process_chunk(self,
739750
chunk_selection,
740751
axis,
741752
operation=self._method,
742-
interface_type="https")
753+
interface_type="https",
754+
option_disable_chunk_cache=chunk_caching,)
743755

744756
elif self.interface_type == 'ActivePosix' and self.version == 2:
745757
# This is where the DDN Fuse and Infinia wrappers go

0 commit comments

Comments
 (0)