Skip to content

Commit

Permalink
Python pre-commit linter fixes
Browse files Browse the repository at this point in the history
	-- A lot of whitespace fixes
  • Loading branch information
turetske committed Nov 4, 2024
1 parent d15e90c commit 89dc65b
Show file tree
Hide file tree
Showing 14 changed files with 477 additions and 356 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Publish PelicanFS distribution to PyPI
on:
on:
release:
types:
- published
Expand Down Expand Up @@ -27,7 +27,7 @@ jobs:
with:
name: python-package-distributions
path: dist/

publish-to-pypi:
if: "!github.event.release.prerelease"
name: >-
Expand Down Expand Up @@ -81,8 +81,8 @@ jobs:
'${{ github.ref_name }}' dist/**
--repo '${{ github.repository }}'
always_job:
name: Always run job
always_job:
name: Always run job
runs-on: ubuntu-latest
steps:
- name: Always run
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/testpypi-publish.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Publish PelicanFS distribution to TestPyPI
on:
on:
release:
types:
- prereleased
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ ds = xarray.open_mfdataset([file1,file2], engine='zarr')

### Specifying Endpoints

The following describes how to specify endpoints to get data from, rather than letting PelicanFS and the director determine the best cache. PelicanFS allows you to specify whether to read directly from the origin (bypassing data staging altogether) or to name a specific cache to stage data into.
The following describes how to specify endpoints to get data from, rather than letting PelicanFS and the director determine the best cache. PelicanFS allows you to specify whether to read directly from the origin (bypassing data staging altogether) or to name a specific cache to stage data into.

**Note**
> If both direct reads and a specific cache are set, PelicanFS will use the specified cache and ignore the direct reads setting.
Expand Down
30 changes: 13 additions & 17 deletions examples/intake/intake-test.py
Original file line number Diff line number Diff line change
@@ -1,30 +1,26 @@
import warnings
"""
A module to do top level testing on intake using pelicanfs
"""

warnings.filterwarnings("ignore")
import warnings

import intake
import numpy as np
import pandas as pd
import xarray as xr
#import hvplot.pandas, hvplot.xarray
#import holoviews as hv
from distributed import LocalCluster, Client
from distributed import Client # LocalCluster
from ncar_jobqueue import NCARCluster
#hv.extension('bokeh')

warnings.filterwarnings("ignore")


if __name__ == '__main__':
if __name__ == "__main__":

# If not using NCAR HPC, use the LocalCluster
#cluster = LocalCluster()
# cluster = LocalCluster()
cluster = NCARCluster()
cluster.scale(10)
# cluster.scale(10)

client = Client(cluster)

catalog = intake.open_esm_datastore(
'file://examples/intake/resources/pelican-test-intake.json'
)
catalog = intake.open_esm_datastore("file://examples/intake/resources/pelican-test-intake.json")

catalog_subset = catalog.search(variable='FLNS', frequency='monthly')
dsets = catalog_subset.to_dataset_dict()
catalog_subset = catalog.search(variable="FLNS", frequency="monthly")
dsets = catalog_subset.to_dataset_dict()
2 changes: 1 addition & 1 deletion examples/intake/resources/pelican-test-intake.csv
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ variable,long_name,component,experiment,forcing_variant,frequency,vertical_level
FLNS,net longwave flux at surface,atm,historical,cmip6,monthly,1.0,global,W/m2,1850-01-16 12:00:00,2014-12-16 12:00:00,osdf:///chtc/PUBLIC/eturetsky/ncar-subset/ncar/monthly/cesm2LE-historical-cmip6-FLNS.zarr
FLNSC,clearsky net longwave flux at surface,atm,historical,cmip6,monthly,1.0,global,W/m2,1850-01-16 12:00:00,2014-12-16 12:00:00,osdf:///chtc/PUBLIC/eturetsky/ncar-subset/ncar/monthly/cesm2LE-historical-cmip6-FLNSC.zarr
FLUT,upwelling longwave flux at top of model,atm,historical,cmip6,monthly,1.0,global,W/m2,1850-01-16 12:00:00,2014-12-16 12:00:00,osdf:///chtc/PUBLIC/eturetsky/ncar-subset/ncar/monthly/cesm2LE-historical-cmip6-FLUT.zarr
FSNS,net solar flux at surface,atm,historical,cmip6,monthly,1.0,global,W/m2,1850-01-16 12:00:00,2014-12-16 12:00:00,osdf:///chtc/PUBLIC/eturetsky/ncar-subset/ncar/monthly/cesm2LE-historical-cmip6-FSNS.zarr
FSNS,net solar flux at surface,atm,historical,cmip6,monthly,1.0,global,W/m2,1850-01-16 12:00:00,2014-12-16 12:00:00,osdf:///chtc/PUBLIC/eturetsky/ncar-subset/ncar/monthly/cesm2LE-historical-cmip6-FSNS.zarr
2 changes: 1 addition & 1 deletion examples/intake/resources/pelican-test-intake.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@
]
},
"last_updated": "2021-12-27T14:29:25Z"
}
}
6 changes: 3 additions & 3 deletions examples/pytorch/pytorch_with_pelicanfs.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import torch
torch.utils.data.datapipes.utils.common.DILL_AVAILABLE = torch.utils._import_utils.dill_available()
from torchdata.datapipes.iter import IterableWrapper

torch.utils.data.datapipes.utils.common.DILL_AVAILABLE = torch.utils._import_utils.dill_available()

if __name__ == '__main__':
if __name__ == "__main__":
dp = IterableWrapper(["osdf:///chtc/PUBLIC/eturetsky/data/faces/"]).list_files_by_fsspec()
print(list(dp))

dp = IterableWrapper(["osdf:///chtc/PUBLIC/eturetsky/data/faces/"]).open_files_by_fsspec()
for path, filestream in dp:
print(path, filestream)
print(path, filestream)
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ package_dir =

[options.packages.find]
where = src
include = pelicanfs*
include = pelicanfs*
48 changes: 25 additions & 23 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from setuptools import setup, find_packages
from setuptools import find_packages, setup

packages = find_packages()
print(packages)
Expand All @@ -7,7 +7,7 @@
name="pelicanfs",
version="1.0.2",
description="An FSSpec Implementation using the Pelican System",
url = "https://github.com/PelicanPlatform/pelicanfs",
url="https://github.com/PelicanPlatform/pelicanfs",
classifiers=[
"Development Status :: 2 - Pre-Alpha",
"Intended Audience :: Science/Research",
Expand All @@ -18,36 +18,38 @@
"License :: OSI Approved :: Apache Software License",
],
entry_points={
'fsspec.specs': [
'pelican=pelicanfs.core.PelicanFileSystem',
'osdf=pelicanfs.core.OSDFFileSystem'
"fsspec.specs": [
"pelican=pelicanfs.core.PelicanFileSystem",
"osdf=pelicanfs.core.OSDFFileSystem",
],
},
keywords="pelican, fsspec",
packages=find_packages(
where='src',
include=['pelicanfs*'],
packages=find_packages(
where="src",
include=["pelicanfs*"],
),
long_description=open('README.md').read(),
long_description_content_type='text/markdown',
long_description=open("README.md").read(),
long_description_content_type="text/markdown",
package_dir={"": "src"},
python_requires=">=3.9, <4",
install_requires=["aiohttp~=3.9.4",
"aiosignal~=1.3.1",
"async-timeout~=4.0.3",
"attrs~=23.2.0",
"frozenlist~=1.4.1",
"fsspec~=2024.3.1",
"idna~=3.7",
"multidict~=6.0.5",
"yarl~=1.9.4",
"cachetools~=5.3"],
install_requires=[
"aiohttp~=3.9.4",
"aiosignal~=1.3.1",
"async-timeout~=4.0.3",
"attrs~=23.2.0",
"frozenlist~=1.4.1",
"fsspec~=2024.3.1",
"idna~=3.7",
"multidict~=6.0.5",
"yarl~=1.9.4",
"cachetools~=5.3",
],
extras_require={
"testing": ["pytest", "pytest-httpserver", "trustme"],
},
"testing": ["pytest", "pytest-httpserver", "trustme"],
},
project_urls={
"Source": "https://github.com/PelicanPlatform/pelicanfs",
"Pelican Source": "https://github.com/PelicanPlatform/pelican",
"Bug Reports":"https://github.com/PelicanPlatform/pelicanfs/issues"
"Bug Reports": "https://github.com/PelicanPlatform/pelicanfs/issues",
},
)
Loading

0 comments on commit 89dc65b

Please sign in to comment.