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

Validator: handle undefined observables more gracefully #300

Closed
dweindl opened this issue Feb 18, 2020 · 0 comments · Fixed by #357
Closed

Validator: handle undefined observables more gracefully #300

dweindl opened this issue Feb 18, 2020 · 0 comments · Fixed by #357
Assignees
Labels
good first issue Good for newcomers

Comments

@dweindl
Copy link
Member

dweindl commented Feb 18, 2020

What happens if measurement table contains an observableId that is not defined in the observables table:

  File "PEtab/petab/lint.py", line 127, in check_measurement_df
    trafo = observable_df.loc[obs_id, OBSERVABLE_TRANSFORMATION]
  File "lib/python3.7/site-packages/pandas/core/indexing.py", line 1761, in __getitem__
    return self._getitem_tuple(key)
  File "lib/python3.7/site-packages/pandas/core/indexing.py", line 1271, in _getitem_tuple
    return self._getitem_lowerdim(tup)
  File "lib/python3.7/site-packages/pandas/core/indexing.py", line 1388, in _getitem_lowerdim
    section = self._getitem_axis(key, axis=i)
  File "lib/python3.7/site-packages/pandas/core/indexing.py", line 1964, in _getitem_axis
    return self._get_label(key, axis=axis)
  File "lib/python3.7/site-packages/pandas/core/indexing.py", line 624, in _get_label
    return self.obj._xs(label, axis=axis)
  File "lib/python3.7/site-packages/pandas/core/generic.py", line 3537, in xs
    loc = self.index.get_loc(key)
  File "lib/python3.7/site-packages/pandas/core/indexes/base.py", line 2648, in get_loc
    return self._engine.get_loc(self._maybe_cast_indexer(key))
  File "pandas/_libs/index.pyx", line 111, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/index.pyx", line 138, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/hashtable_class_helper.pxi", line 1618, in pandas._libs.hashtable.PyObjectHashTable.get_item
  File "pandas/_libs/hashtable_class_helper.pxi", line 1626, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'K27me0K36me0'

What should have happened:
A more informative message should be printed (and potentially validation should continue)

@dweindl dweindl added good first issue Good for newcomers pythonlib labels Feb 18, 2020
@dweindl dweindl added this to the v0.1.3 milestone Feb 28, 2020
@dweindl dweindl self-assigned this Feb 28, 2020
@dweindl dweindl mentioned this issue Feb 28, 2020
dweindl added a commit that referenced this issue Feb 28, 2020
Release 0.1.3

File format:

* Updated documentation
* Observables table in YAML file now mandatory in schema (was implicitly 
  mandatory before, as observable table was required already)

Library:
* petablint:
  * Fix: allow specifying observables file via CLI (Closes #302)
  * Fix: nominalValue is optional unless estimated!=1 anywhere (Fixes #303)
  * Fix: handle undefined observables more gracefully (Closes #300) (#351)
* Parameter mapping: 
  * Fix / refactor parameter mapping (breaking change) (#344)
    (now performing parameter value and scale mapping together)
  * check optional measurement cols in mapping (#350)
* allow calculating llhs (#349), chi2 values (#348) and residuals (#345)
* Visualization
  * Basic Scatterplots & lot of bar plot fixes (#270)
  * Fix incorrect length of bool `bool_preequ` when subsetting with ind_meas 
    (Closes #322)
* make libcombine optional (#338)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant