Skip to content

Commit

Permalink
fixed issue in arrow parms when asset name is provided but is blank
Browse files Browse the repository at this point in the history
  • Loading branch information
jpswinski committed Sep 30, 2024
1 parent 990519e commit 69f3dbf
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 10 deletions.
4 changes: 2 additions & 2 deletions datasets/bathy/package/BathyKd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ double BathyKd::getKd (double lon, double lat)
const int32_t y = static_cast<int32_t>(latitude_pixels);

/* get x offset */
const double degrees_of_longitude = lon + 180.0;
const double degrees_of_longitude = lon + 180.0;
const double longitude_pixels = degrees_of_longitude * 24.0;
const int32_t x = static_cast<int32_t>(longitude_pixels);

Expand All @@ -105,7 +105,7 @@ double BathyKd::getKd (double lon, double lat)
throw RunTimeException(CRITICAL, RTE_ERROR, "Invalid Kd coordinates: %d, %d | %lf, %lf", y, x, degrees_of_latitude, degrees_of_longitude);
}
const long offset = (x * 4320) + y;

/* get kd */
return static_cast<double>((*array)[offset]) * 0.0002;

Expand Down
31 changes: 31 additions & 0 deletions docs/rtd/source/release_notes/release-v4.7.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Release v4.7.1

2024-09-30

Version description of the v4.7.1 release of SlideRule Earth.

## ATL24 Changes

* Fixed default for parameter `thresh` in C-Shelph.
* Fixed calculation of `min_surface_photons_per_window` and `min_bathy_photons_per_window` in OpenOceans++
* Updated models to latest for QTrees, CoastNet, and Ensemble
* Implemented use of `geoid_corr_h` for all classifiers except for the Ensemble. The Ensemble will be updated once it is retrained on the latest round of test results that incorporate the `geoid_corr_h` field. Previously, all classifiers were using non-refraction corrected height, but the ensemble was being trained using the refraction corrected height. Also, any post-test-run validation of the results only had the refraction corrected heights in the output. So the `geoid_corr_h` field was added so that it can clearly represent non-refraction corrected heights, while `ortho_h` includes the refraction correction (and any future corrections we might add).
* QTrees, CoastNet, and OpenOceans++ have been updated with the latest code and are now compiled in as header only libraries.
* MedianFilter and C-Shelph are pulled directly from the ut-ATL24-medianfilter and ut-ATL24-C-shelph repositories
* Version information is included in for all external classifiers (CoastNet, QTrees, OpenOceans++, MedianFilter, C-Shelph)
* Metadata is now provided inside the Parquet and HDF5 files instead of as separate json files.

## Known Issues


## Development Updates



## Getting This Release

[https://github.com/SlideRuleEarth/sliderule/releases/tag/v4.7.1](https://github.com/SlideRuleEarth/sliderule/releases/tag/v4.7.1)

## ATL24 Request Parameters

## Benchmarks
4 changes: 2 additions & 2 deletions packages/arrow/ArrowFields.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ ArrowFields::ArrowFields (void):
{"as_geo", &asGeo},
{"with_checksum", &withChecksum},
{"with_validation", &withValidation},
{"asset_name", &assetName},
{"asset", &assetName},
{"region", &region},
#ifdef __aws__
{"credentials", &credentials},
Expand Down Expand Up @@ -83,7 +83,7 @@ void ArrowFields::fromLua (lua_State* L, int index)
{
/* Get Asset */
Asset* asset = dynamic_cast<Asset*>(LuaObject::getLuaObjectByName(assetName.value.c_str(), Asset::OBJECT_TYPE));
region = StringLib::duplicate(asset->getRegion());
region = asset->getRegion();
credentials = CredentialStore::get(asset->getIdentity());
asset->releaseLuaObject();
}
Expand Down
1 change: 0 additions & 1 deletion packages/arrow/ArrowFields.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ string convertToJson(const ArrowFields::format_t& v);
int convertToLua(lua_State* L, const ArrowFields::format_t& v);
void convertFromLua(lua_State* L, int index, ArrowFields::format_t& v);

inline uint32_t toEncoding(ArrowFields& v) { (void)v; return Field::USER; }
inline uint32_t toEncoding(ArrowFields::format_t& v) { (void)v; return Field::INT32; }


Expand Down
11 changes: 10 additions & 1 deletion packages/arrow/ArrowParms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,14 +163,23 @@ ArrowParms::ArrowParms (lua_State* L, int index):
/* Asset */
lua_getfield(L, index, ASSET);
asset_name = StringLib::duplicate(LuaObject::getLuaString(L, -1, true, NULL, &field_provided));
if(field_provided) mlog(DEBUG, "Setting %s to %s", ASSET, asset_name);
if(field_provided && asset_name != NULL)
{
mlog(DEBUG, "Setting %s to %s", ASSET, asset_name);
if(StringLib::size(asset_name) == 0)
{
delete [] asset_name;
asset_name = NULL;
}
}
lua_pop(L, 1);

#ifdef __aws__
if(asset_name)
{
/* Get Asset */
Asset* asset = dynamic_cast<Asset*>(LuaObject::getLuaObjectByName(asset_name, Asset::OBJECT_TYPE));
if(!asset) throw RunTimeException(CRITICAL, RTE_ERROR, "Unable to find asset: %s", asset_name);

/* Region */
region = StringLib::duplicate(asset->getRegion());
Expand Down
2 changes: 1 addition & 1 deletion packages/core/RequestFields.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ int RequestFields::luaGetField (lua_State* L)
}
catch(const RunTimeException& e)
{
mlog(WARNING, "error retrieving field: %s", e.what());
mlog(WARNING, "unable to retrieve field: %s", e.what());
lua_pushnil(L);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
arrow: apache-arrow-15.0.2-0-ge03105efc
gdal: v3.9.2-0-g3aae5b4cf3
geos: 3.13.0beta2-0-g24ac4f1e5
geos: 3.13.0-0-gd7957246c
libgeotiff: 1.7.3-0-gd2c72db
PROJ: 9.4.1-0-g875a485f
rapidjson: v1.1.0-753-g7c73dd7d
PROJ: 9.5.0-0-g0a407325
rapidjson: v1.1.0-755-g815e6e7e
xgboost: v2.1.1-0-g9c9db1259-dirty

0 comments on commit 69f3dbf

Please sign in to comment.