Skip to content

default_values#55

Merged
PaulJonasJost merged 21 commits intodevelopfrom
default_values
Apr 10, 2025
Merged

default_values#55
PaulJonasJost merged 21 commits intodevelopfrom
default_values

Conversation

@PaulJonasJost
Copy link
Copy Markdown
Collaborator

Handles default values. No default values for measurement table so far, as condition is too specific. Condition is separately asked in a dialogue when uploading.

@PaulJonasJost PaulJonasJost changed the base branch from main to develop January 21, 2025 14:22
@PaulJonasJost PaulJonasJost self-assigned this Jan 21, 2025
Copy link
Copy Markdown
Collaborator

@fbergmann fbergmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if i start with a new model i cannot enter a new condition:

Traceback (most recent call last):
  File "~/pyPESTO_GUI/src/petab_gui/models/pandas_table_model.py", line 139, in setData
    self.insertRows(index.row(), 1)
  File "~/pyPESTO_GUI/src/petab_gui/models/pandas_table_model.py", line 104, in insertRows
    self._data_frame.loc[end_position + i] = /
    ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
  File "~/.conda/envs/env-penguin/Lib/site-packages/pandas/core/indexing.py", line 911, in __setitem__
    iloc._setitem_with_indexer(indexer, value, self.name)
  File "~/.conda/envs/env-penguin/Lib/site-packages/pandas/core/indexing.py", line 1932, in _setitem_with_indexer
    self._setitem_with_indexer_missing(indexer, value)
  File "~/.conda/envs/env-penguin/Lib/site-packages/pandas/core/indexing.py", line 2290, in _setitem_with_indexer_missing
    raise ValueError("cannot set a frame with no defined columns")
ValueError: cannot set a frame with no defined columns

Copy link
Copy Markdown
Collaborator

@fbergmann fbergmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • default obs, pearmaetr, observable id's: 'new measurement', 'new observable', 'new parameter' are invalid.

  • adding a new observableFormula does not yet fill out the id (leaving it an invalid numeric)

  • adding a measurement, adds the new observableid to the observable table ... but a simulation condition is not added to the condition table.

  • adding a parameter that exists in the model to the parameter table gives the linter error: PEtab linter failed at row 1, column 0: Expected numeric values for nominalValue in parameter table for all non-estimated parameters. even though estimate is 1. it would be fine if the nominalValue could be taken from the model

# Conflicts:
#	src/petab_gui/models/pandas_table_model.py
PaulJonasJost added a commit that referenced this pull request Jan 22, 2025
…plus conditionId index). Fixes bug mentioned in #55
PaulJonasJost added a commit that referenced this pull request Jan 22, 2025
Changed the default columns in condition to have at least on column (plus conditionId index). Fixes bug mentioned in #55 (#57)
@PaulJonasJost
Copy link
Copy Markdown
Collaborator Author

if i start with a new model i cannot enter a new condition:

Traceback (most recent call last):
  File "~/pyPESTO_GUI/src/petab_gui/models/pandas_table_model.py", line 139, in setData
    self.insertRows(index.row(), 1)
  File "~/pyPESTO_GUI/src/petab_gui/models/pandas_table_model.py", line 104, in insertRows
    self._data_frame.loc[end_position + i] = /
    ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
  File "~/.conda/envs/env-penguin/Lib/site-packages/pandas/core/indexing.py", line 911, in __setitem__
    iloc._setitem_with_indexer(indexer, value, self.name)
  File "~/.conda/envs/env-penguin/Lib/site-packages/pandas/core/indexing.py", line 1932, in _setitem_with_indexer
    self._setitem_with_indexer_missing(indexer, value)
  File "~/.conda/envs/env-penguin/Lib/site-packages/pandas/core/indexing.py", line 2290, in _setitem_with_indexer_missing
    raise ValueError("cannot set a frame with no defined columns")
ValueError: cannot set a frame with no defined columns

Adressed in #57

@fbergmann
Copy link
Copy Markdown
Collaborator

ok, that fix worked, but only if i manually change C.py on my machine. The merge earlier didnt do it. Next time it might be best, to just add the commits to the current PR. In anycase. I cann now add new conditions.

@PaulJonasJost PaulJonasJost requested a review from fbergmann March 11, 2025 10:21
@fbergmann
Copy link
Copy Markdown
Collaborator

while trying I have the following error:

Traceback (most recent call last):
  File "~/pyPESTO_GUI/src/petab_gui/controllers/mother_controller.py", line 635, in check_model
    failed = self.model.test_consistency()
  File "~/pyPESTO_GUI/src/petab_gui/models/petab_model.py", line 112, in test_consistency
    return petab.lint.lint_problem(self.current_petab_problem)
           ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/frank/env-penguin/lib/python3.13/site-packages/petab/v1/lint.py", line 910, in lint_problem
    check_measurement_df(problem.measurement_df, problem.observable_df)
    ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/frank/env-penguin/lib/python3.13/site-packages/petab/v1/lint.py", line 200, in check_measurement_df
    if measurement <= 0.0 and trafo in [LOG, LOG10]:
       ^^^^^^^^^^^^^^^^^^
TypeError: '<=' not supported between instances of 'str' and 'float'
Traceback (most recent call last):
  File "~/pyPESTO_GUI/src/petab_gui/controllers/mother_controller.py", line 635, in check_model
    failed = self.model.test_consistency()
  File "~/pyPESTO_GUI/src/petab_gui/models/petab_model.py", line 112, in test_consistency
    return petab.lint.lint_problem(self.current_petab_problem)
           ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/frank/env-penguin/lib/python3.13/site-packages/petab/v1/lint.py", line 910, in lint_problem
    check_measurement_df(problem.measurement_df, problem.observable_df)
    ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/frank/env-penguin/lib/python3.13/site-packages/petab/v1/lint.py", line 200, in check_measurement_df
    if measurement <= 0.0 and trafo in [LOG, LOG10]:
       ^^^^^^^^^^^^^^^^^^
TypeError: '<=' not supported between instances of 'str' and 'float'

# Conflicts:
#	src/petab_gui/app.py
#	src/petab_gui/controllers/mother_controller.py
#	src/petab_gui/controllers/table_controllers.py
#	src/petab_gui/controllers/utils.py
#	src/petab_gui/models/pandas_table_model.py
#	src/petab_gui/utils.py
#	src/petab_gui/views/main_view.py
@PaulJonasJost PaulJonasJost merged commit 3cdb29b into develop Apr 10, 2025
@PaulJonasJost PaulJonasJost deleted the default_values branch April 10, 2025 19:27
@PaulJonasJost PaulJonasJost mentioned this pull request Apr 23, 2025
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

Successfully merging this pull request may close these issues.

2 participants