Skip to content

Problem running the example usage listed in ReadMe (xml token error) #122

@amsayer

Description

@amsayer

Hi, I'm having an issue running the example maap-py usage in the ReadMe and if I read that correctly you want problems posted here as opposed to email. I'm not a super-advanced Python user but have colleagues who are, and they've looked things over and can't see anything obviously wrong with my install or what I'm doing. My longer-term goal is to do some analyses with NASA PACE and ESA EarthCARE data using MAAP but initial goal is just to get these libraries running and understand what they're doing.

First I tried "python setup.py test" as indicated at the bottom of the repo - there doesn't seem to be a setup.py included in the package, though?

Next I tried this:

$ python
>>> from maap.maap import MAAP
>>> maap = MAAP()

>>> granules = maap.searchGranule(sitename='lope', instrument='uavsar')
>>> for res in granules:
    print(res.getDownloadUrl())
    res.download()

The first two lines didn't throw up any issues. But running the third line I get this:

>>> granules = maap.searchGranule(sitename='lope', instrument='uavsar')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/accounts/asayer/python/maap-py/maap/maap.py", line 323, in searchGranule
    results = self._CMR.get_search_results(url=self.config.search_granule_url, limit=limit, **kwargs)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/accounts/asayer/python/maap-py/maap/utils/CMR.py", line 41, in get_search_results
    page = ET.XML(unparsed_page)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/accounts/asayer/miniforge3/envs/my_environment/lib/python3.11/xml/etree/ElementTree.py", line 1350, in XML
    parser.feed(text)
xml.etree.ElementTree.ParseError: not well-formed (invalid token): line 1, column 39

Any idea what is wrong? Sounds like something in the query is breaking an xml file, I don't know if this is an issue with the code or with the example or something else.

One note: the ReadMe says: "Populate your MAAP base url into a maap.cfg file, using maap.cfg as a template." maap.cfg as linked on github and distributed is empty, a colleague who has used this before says that's ok. But I thought I'd mention just in case. I don't know what my MAAP base url should be.

Please let me know if you need any info to help debug this!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions