Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intermittent Error on order_granules #463

Open
rwegener2 opened this issue Oct 26, 2023 · 0 comments
Open

Intermittent Error on order_granules #463

rwegener2 opened this issue Oct 26, 2023 · 0 comments

Comments

@rwegener2
Copy link
Contributor

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().

Full code to reproduce

I'm running this code on CryoCloud.

from icepyx.core.query import Query

short_name = 'ATL06'
spatial_extent = [-55, 68, -48, 71]
date_range = ['2019-02-20','2019-02-28']
region = Query(short_name, spatial_extent, date_range)
region.order_vars.append(beam_list=['gt1l'], var_list=['h_li', "latitude", "longitude"])
region.order_granules(Coverage=region.order_vars.wanted)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant