PyOOS Exception processing getObservation response

12 views
Skip to first unread message

dan

unread,
Jan 27, 2014, 12:45:35 PM1/27/14
to py...@googlegroups.com
Testing against the test 52 N server:
dataCollector = IoosSweSos(url='http://ioossos.axiomalaska.com/52n-sos-ioos-stable/sos/kvp', xml=None)
 
with a filter:
              dataCollector.filter(
                                  features=[offer.name],
                                   variables=obsToQuery,
                                   start=offer.begin_position,
                                   end=offer.end_position)

Throws an exception:
Traceback (most recent call last):
  File "/Users/danramage/Documents/workspace/pycharm/PyOOS-SOS/PyOOSDataIngest.py", line 117, in main
    response = dataCollector.collect(offerings=[offer.name])
  File "/Users/danramage/pyenv2.7-pyoos/lib/python2.7/site-packages/pyoos-0.6_dev-py2.7.egg/pyoos/collectors/ioos/swe_sos.py", line 73, in collect
    return IoosGetObservation(self.raw(**kwargs)).observations
  File "/Users/danramage/pyenv2.7-pyoos/lib/python2.7/site-packages/pyoos-0.6_dev-py2.7.egg/pyoos/parsers/ioos/one/get_observation.py", line 29, in __init__
    ob_ele = OmObservation(ob)
  File "/Users/danramage/pyenv2.7-pyoos/lib/python2.7/site-packages/pyoos-0.6_dev-py2.7.egg/pyoos/parsers/ioos/one/get_observation.py", line 102, in __init__
    self.feature = TimeSeriesProfile(data).feature
TypeError: object.__new__() takes no parameters


mayorga

unread,
Jan 27, 2014, 2:29:48 PM1/27/14
to py...@googlegroups.com
Dan,

It's hard to see what else is going on in your code, to assess whether this really is a problem on the 52N server or in your code. I haven't run into problems in my most recent tests with that endpoint (over 10 days ago), other than the jumping, unpredictable start-end times (which Shane described in another email today).

I just ran a test similar to yours, and didn't see any problems.

Things that come to mind from your snippet and the error message:
- is obsToQuery a list?
- The collect statement only has an offerings argument:

  response = dataCollector.collect(offerings=[offer.name])

I have to admit that I'm still confused with pyoos about whether the "filter" method, as in your code, is 100% equivalent to setting properties on a data collector (eg, dataCollector.start_time = offer.begin_position). I've tended to stick with the latter pattern b/c it seems more straightforward and I've run into fewer glitches with it. See https://www.wakari.io/sharing/bundle/emayorga/pyoos1_test_2

BTW, Rich just told me that sharing bundled environments with a Wakari notebook has been re-enabled! I'll try to share my pyoos+ Wakari env later today.

Cheers,
-Emilio

Dan Ramage

unread,
Jan 27, 2014, 2:38:59 PM1/27/14
to mayorga, py...@googlegroups.com
Emilio,

I'm thinking it's a PyOOS issue since I do get a response from the 52 N server. Although it could be an issue with my local PyOOS or possibly the response is no good. I wish I could make more progress, but I seem to be the harbinger of issues.

Dan


--
You received this message because you are subscribed to the Google Groups "pyoos" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyoos+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Dave Foster

unread,
Jan 27, 2014, 3:27:57 PM1/27/14
to py...@googlegroups.com, mayorga
Ah - TimeSeriesProfile support is not yet merged (see https://github.com/asascience-open/pyoos/tree/timeseriesprofile) - there's a stub in master which it is calling and failing on.

Just haven't had a chance to merge.  Was waiting on new OWSlib release (happened) and paegan release (need to do)  Hopefully soon.

Emilio Mayorga

unread,
Jan 27, 2014, 4:03:13 PM1/27/14
to Dave Foster, py...@googlegroups.com
Good catch, Dave. I looked too quickly at the error messages and didn't realize that it was trying to call TimeSeriesProfile.

Dan, what "offer.name" were you using in your test?

-Emilio

Dan Ramage

unread,
Jan 28, 2014, 7:29:42 AM1/28/14
to Emilio Mayorga, Dave Foster, py...@googlegroups.com
I was just looping through the offerings .

Dave Foster

unread,
Jan 28, 2014, 9:05:01 AM1/28/14
to Dan Ramage, Emilio Mayorga, py...@googlegroups.com
Dan, a quick workaround for now would be to use something like this in place of the TimeSeriesProfile, if you access to go edit the source .py as it is installed:

class TimeSeriesProfile(object):
    def __init__(self, *args, **kwargs):
        self.feature = None

That might get you slightly further, although the “feature” item might need an attribute “observations”.

So, maybe this:

class FakeFeature(object):
    def __init__(self):
        self.observations = []

class TimeSeriesProfile(object):
    def __init__(self, *args, **kwargs):
        self.feature = FakeFeature()


Just brainstorming for now.


Dan Ramage

unread,
Jan 28, 2014, 9:26:16 AM1/28/14
to Dave Foster, Emilio Mayorga, py...@googlegroups.com
Dave,

What's the status of getting an updated ncSOS release to deal with the event time problem I reported. Instead of hacking on a workaround in PyOOS, if I can get a smaller time series from our ncSOS server then I can probably progress more on that front.


Dan
Reply all
Reply to author
Forward
0 new messages