Skip to content

Commit

Permalink
handle case where large poly is used but still want to lock entire node
Browse files Browse the repository at this point in the history
  • Loading branch information
jpswinski committed Jan 18, 2024
1 parent 60e7759 commit 41ddba4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion clients/python/sliderule/earthdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,7 @@ def search(parm, resources=None):
cmr_kwargs = {}

# Pull Out Polygon
if "use_poly_for_cmr" not in parm or parm["use_poly_for_cmr"]:
if "ignore_poly_for_cmr" not in parm or not parm["ignore_poly_for_cmr"]:
if "clusters" in parm and parm["clusters"] and len(parm["clusters"]) > 0:
cmr_kwargs['polygon'] = parm["clusters"]
elif "poly" in parm and parm["poly"] and len(parm["poly"]) > 0:
Expand Down
6 changes: 3 additions & 3 deletions docs/rtd/source/user_guide/SlideRule.rst
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ All polygons provided to SlideRule must be provided as a list of dictionaries co

* ``"poly"``: polygon of region of interest
* ``"proj"``: projection used when subsetting data ("north_polar", "south_polar", "plate_carree"). In most cases, do not specify and code will do the right thing.
* ``"use_poly_for_cmr"``: boolean for whether to use the polygon as a part of the request to CMR for obtaining the list of resources to process. By default the polygon is used and this is only here for unusual cases where SlideRule is able to handle a polygon for subsetting that CMR cannot, and the list of resources to process is obtained some other way.
* ``"ignore_poly_for_cmr"``: boolean for whether to use the polygon as a part of the request to CMR for obtaining the list of resources to process. By default the polygon is used and this is only here for unusual cases where SlideRule is able to handle a polygon for subsetting that CMR cannot, and the list of resources to process is obtained some other way.

For example:

Expand Down Expand Up @@ -304,9 +304,9 @@ The default set of parameters used by SlideRule are set to match anticipated use
* - ``"proj"``
- String
-
* - ``"use_poly_for_cmr"``
* - ``"ignore_poly_for_cmr"``
- Boolean
- True
- False
* - ``"raster"``
- String, JSON
-
Expand Down
5 changes: 3 additions & 2 deletions packages/core/LuaLibrarySys.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,9 @@ int LuaLibrarySys::lsys_log (lua_State* L)
int LuaLibrarySys::lsys_metric (lua_State* L)
//TODO: need to populate with metrics...
{
(void)L;
return 0;
lua_newtable(L);
LuaEngine::setAttrInt(L, "alive", 1);
return 1;
}

/*----------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion scripts/extensions/proxy.lua
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ local function proxy(resources, parms, endpoint, rec, lon, lat)

-- Determine Locks per Node --
local MaxNodesPerLock = 3
local locks_per_node = parms["poly"] and 1 or MaxNodesPerLock
local locks_per_node = (parms["poly"] and not parms["ignore_poly_for_cmr"]) and 1 or MaxNodesPerLock

-- Proxy Request --
local proxy = netsvc.proxy(endpoint, resources, json.encode(parms), node_timeout, locks_per_node, rsps_from_nodes, terminate_proxy_stream)
Expand Down

0 comments on commit 41ddba4

Please sign in to comment.