When running an order_granules call such as: region.order_granules(Coverage=region.order_vars.wanted) (where region is a Query object)
I intermittently receive the error:
---------------------------------------------------------------------------
UnboundLocalError Traceback (most recent call last)
Cell In[7], line 1
----> 1 region.order_granules(Coverage=region.order_vars.wanted)
File ~/icepyx/icepyx/core/query.py:1066, in Query.order_granules(self, verbose, subset, email, **kwargs)
1055 self._granules.place_order(
1056 tempCMRparams,
1057 self.reqparams,
(...)
1062 geom_filepath=self._spatial._geom_file,
1063 )
1065 else:
-> 1066 self._granules.place_order(
1067 self.CMRparams,
1068 self.reqparams,
1069 self.subsetparams(**kwargs),
1070 verbose,
1071 subset,
1072 session=self.session,
1073 geom_filepath=self._spatial._geom_file,
1074 )
File ~/icepyx/icepyx/core/granules.py:443, in Granules.place_order(self, CMRparams, reqparams, subsetparams, verbose, subset, session, geom_filepath)
441 print("Your order is:", status)
442 messagelist = []
--> 443 for message in loop_root.findall("./processInfo/info"):
444 messagelist.append(message.text)
445 if messagelist != []:
UnboundLocalError: cannot access local variable 'loop_root' where it is not associated with a value
The error sometimes appears and other times does not, which makes me think it is being caused to some kind of race condition. The granules.py lines to be related to reading the output of an API response, which makes a race condition plausible. I believe a similar error also happened once while calling region.download_granules().
When running an order_granules call such as:
region.order_granules(Coverage=region.order_vars.wanted)
(whereregion
is a Query object)I intermittently receive the error:
The error sometimes appears and other times does not, which makes me think it is being caused to some kind of race condition. The
granules.py
lines to be related to reading the output of an API response, which makes a race condition plausible. I believe a similar error also happened once while callingregion.download_granules()
.Full code to reproduce
I'm running this code on CryoCloud.