Skip to content

Getting Examples/Sample.py to work with LBR ODM2 SQLite db #24

@emiliom

Description

@emiliom

@denvaar here's what I'm trying. I have Jeff's ODM2.sqlite db for the Little Bear River, with a single timeseries result. I'm trying to run Examples/Sample.py. I was hoping it would work!

I can connect to (read) the database, and query some objects. But I'll jump to the core and major problem I'm running into.

FYI, the sqlite db only has 1 result. No sweat. I run this statement tsResult = read.getTimeSeriesResultByResultId(1) in line 130. The resulting object matches closely the table definition of TimeSeriesResults. But it's clear that in Sample.py what's expected is an object that includes the associated Results; for example, there are statements like these:

tsResult.ResultTypeCV
tsResult.ProcessingLevelObj.Definition

But tsResult doesn't have any of those Results properties.

Ok, moving on, I try to get the time series result values, like this: tsValues = read.getTimeSeriesResultValuesByResultId(1). It doesn't work, and returns None.

read.getResultById(1) does return the single Results record.

The sqlite database looks fine to me, when I inspect its tables via a SQLite browser.

I also have other problems that seem puzzling. For example, read.getAllAffiliations() returns None, not the affiliations record.

Note that I'm not running Sample.py in full. I'm taking each distinct block and running it in a Jupyter notebook. I'm skipping the "add sampling feature" block, b/c I'm not interested in writing to the database at this time.

Thanks!

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