Skip to content

PyOpenSci review updates including optimizing and consolidating conver_byte_size, cleanup with black for flake8 warnings #17

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

Merged
merged 10 commits into from
Apr 9, 2025
Merged
5 changes: 5 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[flake8]
max-line-length = 88
ignore = E203, E501, W503, W504
per-file-ignores =
__init__.py: F401
51 changes: 35 additions & 16 deletions examples/nu_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,45 @@
import os

# download some veg structure data
veg = nu.load_by_product(dpid='DP1.10098.001', site=['WREF','RMNP'],
startdate='2022-01', enddate='2023-12',
include_provisional=True, check_size=False,
token=os.environ.get('NEON_TOKEN'))
veg = nu.load_by_product(
dpid="DP1.10098.001",
site=["WREF", "RMNP"],
startdate="2022-01",
enddate="2023-12",
include_provisional=True,
check_size=False,
token=os.environ.get("NEON_TOKEN"),
)
# see what data tables were returned
veg.keys()

# download 30-minute PAR data
par = nu.load_by_product(dpid='DP1.00024.001', site='RMNP',
startdate='2023-06', enddate='2023-07',
timeindex=30, package='expanded',
include_provisional=True, check_size=False,
token=os.environ.get('NEON_TOKEN'))
par = nu.load_by_product(
dpid="DP1.00024.001",
site="RMNP",
startdate="2023-06",
enddate="2023-07",
timeindex=30,
package="expanded",
include_provisional=True,
check_size=False,
token=os.environ.get("NEON_TOKEN"),
)

# download CHM tiles covering the veg structure plots at WREF
pppy = veg['vst_perplotperyear']
east = pppy['easting'].to_list()
north = pppy['northing'].to_list()
pppy = veg["vst_perplotperyear"]
east = pppy["easting"].to_list()
north = pppy["northing"].to_list()

nu.by_tile_aop(dpid='DP3.30015.001', site='WREF', year=2023,
easting=east, northing=north, buffer=20,
include_provisional=True, check_size=False,
savepath='INSERT FILE PATH', token=os.environ.get('NEON_TOKEN'))
nu.by_tile_aop(
dpid="DP3.30015.001",
site="WREF",
year=2023,
easting=east,
northing=north,
buffer=20,
include_provisional=True,
check_size=False,
savepath="INSERT FILE PATH",
token=os.environ.get("NEON_TOKEN"),
)
7 changes: 6 additions & 1 deletion src/neonutilities/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
from .citation import get_citation
from .aop_download import by_file_aop, by_tile_aop, list_available_dates, get_aop_tile_extents
from .aop_download import (
by_file_aop,
by_tile_aop,
list_available_dates,
get_aop_tile_extents,
)
from .tabular_download import zips_by_product
from .get_issue_log import get_issue_log
from .read_table_neon import read_table_neon
Expand Down
Loading