Skip to content

Commit 1124cef

Browse files
authored
Merge pull request #17 from NEONScience/bh_pos
PyOpenSci review updates including optimizing and consolidating conver_byte_size, cleanup with black for flake8 warnings
2 parents b4c9873 + a9a751c commit 1124cef

15 files changed

+1840
-1171
lines changed

.flake8

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[flake8]
2+
max-line-length = 88
3+
ignore = E203, E501, W503, W504
4+
per-file-ignores =
5+
__init__.py: F401

examples/nu_example.py

+35-16
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,45 @@
22
import os
33

44
# download some veg structure data
5-
veg = nu.load_by_product(dpid='DP1.10098.001', site=['WREF','RMNP'],
6-
startdate='2022-01', enddate='2023-12',
7-
include_provisional=True, check_size=False,
8-
token=os.environ.get('NEON_TOKEN'))
5+
veg = nu.load_by_product(
6+
dpid="DP1.10098.001",
7+
site=["WREF", "RMNP"],
8+
startdate="2022-01",
9+
enddate="2023-12",
10+
include_provisional=True,
11+
check_size=False,
12+
token=os.environ.get("NEON_TOKEN"),
13+
)
914
# see what data tables were returned
1015
veg.keys()
1116

1217
# download 30-minute PAR data
13-
par = nu.load_by_product(dpid='DP1.00024.001', site='RMNP',
14-
startdate='2023-06', enddate='2023-07',
15-
timeindex=30, package='expanded',
16-
include_provisional=True, check_size=False,
17-
token=os.environ.get('NEON_TOKEN'))
18+
par = nu.load_by_product(
19+
dpid="DP1.00024.001",
20+
site="RMNP",
21+
startdate="2023-06",
22+
enddate="2023-07",
23+
timeindex=30,
24+
package="expanded",
25+
include_provisional=True,
26+
check_size=False,
27+
token=os.environ.get("NEON_TOKEN"),
28+
)
1829

1930
# download CHM tiles covering the veg structure plots at WREF
20-
pppy = veg['vst_perplotperyear']
21-
east = pppy['easting'].to_list()
22-
north = pppy['northing'].to_list()
31+
pppy = veg["vst_perplotperyear"]
32+
east = pppy["easting"].to_list()
33+
north = pppy["northing"].to_list()
2334

24-
nu.by_tile_aop(dpid='DP3.30015.001', site='WREF', year=2023,
25-
easting=east, northing=north, buffer=20,
26-
include_provisional=True, check_size=False,
27-
savepath='INSERT FILE PATH', token=os.environ.get('NEON_TOKEN'))
35+
nu.by_tile_aop(
36+
dpid="DP3.30015.001",
37+
site="WREF",
38+
year=2023,
39+
easting=east,
40+
northing=north,
41+
buffer=20,
42+
include_provisional=True,
43+
check_size=False,
44+
savepath="INSERT FILE PATH",
45+
token=os.environ.get("NEON_TOKEN"),
46+
)

src/neonutilities/__init__.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
from .citation import get_citation
2-
from .aop_download import by_file_aop, by_tile_aop, list_available_dates, get_aop_tile_extents
2+
from .aop_download import (
3+
by_file_aop,
4+
by_tile_aop,
5+
list_available_dates,
6+
get_aop_tile_extents,
7+
)
38
from .tabular_download import zips_by_product
49
from .get_issue_log import get_issue_log
510
from .read_table_neon import read_table_neon

0 commit comments

Comments
 (0)