Skip to content

Commit

Permalink
Merge pull request #98 from IMMM-SFA/dev
Browse files Browse the repository at this point in the history
v2.3.2
  • Loading branch information
crvernon committed Mar 15, 2023
2 parents 72530d7 + 684b668 commit 00bc275
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion cerf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
from .install_supplement import install_package_data


__version__ = "2.3.1"
__version__ = "2.3.2"
3 changes: 2 additions & 1 deletion cerf/install_supplement.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ class InstallSupplement:
'2.2.0': 'https://zenodo.org/record/6998151/files/cerf_package_data.zip?download=1',
'2.2.1': 'https://zenodo.org/record/6998151/files/cerf_package_data.zip?download=1',
'2.3': 'https://zenodo.org/record/6998151/files/cerf_package_data.zip?download=1',
'2.3.1': 'https://zenodo.org/record/6998151/files/cerf_package_data.zip?download=1'}
'2.3.1': 'https://zenodo.org/record/6998151/files/cerf_package_data.zip?download=1',
'2.3.2': 'https://zenodo.org/record/6998151/files/cerf_package_data.zip?download=1'}

def __init__(self, data_dir=None):

Expand Down
11 changes: 7 additions & 4 deletions cerf/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

import os
import logging
import tempfile

Expand Down Expand Up @@ -331,14 +331,17 @@ def ingest_sited_data(run_year,
# update data type
metadata.update(dtype=np.uint32)

with tempfile.NamedTemporaryFile() as tmpfile:
with tempfile.TemporaryDirectory() as tempdir:

# construct temporary raster file name
out_temp_rast = os.path.join(tempdir, "cerf_temp_raster.tif")

# write array as spatial in a temp file
with rasterio.open(tmpfile, "w", **metadata) as dest:
with rasterio.open(out_temp_rast, "w", **metadata) as dest:
dest.write(index_arr, 1)

# read temp file to use for grid search
with rasterio.open(tmpfile.name) as idx:
with rasterio.open(out_temp_rast) as idx:
index_generator = idx.sample(df_active[["xcoord", "ycoord"]].values)
located_index_list = [i[0] for i in index_generator]

Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import sphinx_rtd_theme

# import cerf
version = "2.3.1" #str(cerf.__version__)
version = "2.3.2" #str(cerf.__version__)


sys.path.insert(0, os.path.abspath('../../'))
Expand Down

0 comments on commit 00bc275

Please sign in to comment.