Skip to content

Releases: ks905383/xagg

v0.3.2.3

21 Aug 18:14
Compare
Choose a tag to compare

Minor updates

  • wm.diag_fig() no longer needs the extra subset_find step to homogenize grids
  • wm.diag_fig() now covered by tests
  • minor bug fixes

What's Changed

  • Create tests for diag_fig() robustness, make auxfuncs work with silent option by @ks905383 in #76

Full Changelog: v0.3.2.2...v0.3.2.3

0.3.2.2

08 Aug 22:07
Compare
Choose a tag to compare

Updates

  • Regridding weights to the input dataset grid now uses the "conservative" regridding algorithm from xesmf instead of the "bilinear" one; the bilinear one is inappropriate for many weights (population, etc.), since it throws away many low-valued source boxes.
  • Weights now have nans set to 0 before regridding, to make sure nan pixels are included in weights. Since nans usually imply 0s in weights (for example, population weights for which water surfaces are set to nan), this prevents entire coarser pixels from being set to 0 if they overlap with a nan
  • Both of the above can be changed with xa.set_options(rgrd_alg='bilinear',nan_to_zero_regridding=False), respectively.

Bug fixes

  • wm.diag_fig() now accepts DataArrays, as stated in docs.

What's Changed

Full Changelog: v0.3.2.1...v0.3.2.2

v0.3.2.1

04 Jun 15:57
Compare
Choose a tag to compare

Major updates

Creates a module-wide way to set defaults for :

  • silencing behavior
  • backend algorithm

So, for example, to set the backend to use the dot product implementation, call:

import xagg as xa
xa.set_options(impl='dot_product')

Alternatively, use a with block for individual chunks of code, here using an example with silent:

with xa.set_options(silent=True):
     wm = xa.pixel_overlaps(ds,gdf)

which silences all status updates.

Bug fixes

Closes #55 ; silent=True now should suppress all status updates to standard out.

v0.3.2.0

14 Feb 00:11
Compare
Choose a tag to compare

Major Changes

Features

  • xesmf is now an optional dependency, which should remove a lot of installation issues; this should close #47 .
  • Support for Windows: the aux module has been renamed auxfuncs; together with making the xesmf dependency optional, this should close #23 #22 #58 .
  • The weightmap class now has a new method that creates diagnostic figures, showing individual polygons and the grid that overlaps with them, shaded by overlapping area. Try it out and let me know what you think! (wm.diag_fig())

Bug fixes

  • xagg is now more robust to grids with a challenging relationship with major longitudes / latitudes: notably, grids can now have grid cells that cross the antimeridian (following GeoJSON conventions of splitting those into MultiPolygons)
  • xa.aux.get_bnds() now works with grids that are misaligned with the antimeridian, that only partially cross the antimeridian, or that have half pixels at the poles
  • xa.core.process_weights() now will match weights grids to ds grids even if they are np.allclose() but not identical, and throws a warning if the resultant weights variables is entirely 0s or np.nans
  • xa.aux.normalize() will now return np.nan arrays if the vector is entirely 0s (to avoid the divide by 0 warning)
  • silent=True should now actually prevent all normal standard output. Most warnings are unaffected. Closes #55 .

Short Changelog

Full Changelog: v0.3.1.1...v0.3.2.0

v0.3.1.1

29 Nov 20:12
Compare
Choose a tag to compare

Bug Fixes

Fixes dimension mismatch issue in #50.

v0.3.1

03 Jul 18:36
Compare
Choose a tag to compare

New features:

  • Suppress status updates through silent=True feature, closes #38

Bug fixes:

  • Fixes incorrect for loop call, closes #37
  • Fixes warnings and errors from gpd.overlay(), closes #24
  • Addresses a few FutureWarnings, etc.
  • Fixes ESMF installation issue.

v0.3.0.2

10 Apr 23:50
Compare
Choose a tag to compare

Bug fixes

  • .to_dataset() functions again
  • .read_wm() is now loaded by default

What's Changed

Full Changelog: v0.3.0.1...v0.3.0.2

v0.3.0.1

07 Apr 17:57
Compare
Choose a tag to compare

Fixes dependency error in setup.py that was preventing publication of v0.3* on conda-forge.

Full Changelog: v0.3.0...v0.3.0.1

v0.3.0

02 Apr 19:39
Compare
Choose a tag to compare

Performance upgrades

Various performance upgrades, particularly for working with high resolution grids.

In create_raster_polygons:

  • replacing the for-loop assigning pixels to polygons with a lambda apply
  • creating flexible buffer for subsetting to bounding box, replacing the hardcoded 0.1 degrees used previously with twice the max grid spacing

In aggregate:

  • an optional replacement of the aggregating calculation with a dot-product implementation (impl='dot_product' in pixel_overlaps() and aggregate()), which may improve performance in certain situations

Expanded functionality

Weightmaps can now be saved using wm.to_file() and loaded using xagg.core.read_wm(), and no longer have to be regenerated with each code run.

Bug fixes

Various bug fixes

What's Changed

  • speed improvement for high res grids in create_raster_polygons by @kerriegeil in #29
  • dot product implementation by @jsadler2 in #4
  • Speedup for large grids - mod gdf_pixels in create_raster_polgons by @kerriegeil in #30
  • implement making dot product optional, restoring default agg behavior by @ks905383 in #32
  • Implement a way to save weightmaps (output from pixel_overlaps) by @ks905383 in #33

New Contributors

Full Changelog: v0.2.6...v0.3.0

v0.2.6

26 Jan 20:48
57d9cbf
Compare
Choose a tag to compare

Bug fixes:

  • #11 pixel_overlaps no longer changes the gdf_in outside of the function

Functionality tweaks

  • added agg.to_geodataframe(), similar to agg.to_dataframe(), but keeping the geometries from the original shapefile
  • adapted xarray's ds.to_dataframe() in agg.to_dataframe(), which has better functionality
  • .csvs now export long instead of wide, using the output from ds.to_dataframe() above