Skip to content

Commit 19e8ad6

Browse files
committed
Remove vis info from petab.v2
Remove visualization tables until there is progress on #398.
1 parent 153f2bd commit 19e8ad6

File tree

4 files changed

+5
-159
lines changed

4 files changed

+5
-159
lines changed

petab/v2/C.py

Lines changed: 0 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -233,114 +233,6 @@
233233
#: Supported noise distributions
234234
NOISE_DISTRIBUTIONS = [NORMAL, LAPLACE, LOG_NORMAL, LOG_LAPLACE]
235235

236-
237-
# VISUALIZATION
238-
239-
#: Plot ID column in the visualization table
240-
PLOT_ID = "plotId"
241-
#: Plot name column in the visualization table
242-
PLOT_NAME = "plotName"
243-
#: Value for plot type 'simulation' in the visualization table
244-
PLOT_TYPE_SIMULATION = "plotTypeSimulation"
245-
#: Value for plot type 'data' in the visualization table
246-
PLOT_TYPE_DATA = "plotTypeData"
247-
#: X values column in the visualization table
248-
X_VALUES = "xValues"
249-
#: X offset column in the visualization table
250-
X_OFFSET = "xOffset"
251-
#: X label column in the visualization table
252-
X_LABEL = "xLabel"
253-
#: X scale column in the visualization table
254-
X_SCALE = "xScale"
255-
#: Y values column in the visualization table
256-
Y_VALUES = "yValues"
257-
#: Y offset column in the visualization table
258-
Y_OFFSET = "yOffset"
259-
#: Y label column in the visualization table
260-
Y_LABEL = "yLabel"
261-
#: Y scale column in the visualization table
262-
Y_SCALE = "yScale"
263-
#: Legend entry column in the visualization table
264-
LEGEND_ENTRY = "legendEntry"
265-
266-
#: Mandatory columns of visualization table
267-
VISUALIZATION_DF_REQUIRED_COLS = [PLOT_ID]
268-
269-
#: Optional columns of visualization table
270-
VISUALIZATION_DF_OPTIONAL_COLS = [
271-
PLOT_NAME,
272-
PLOT_TYPE_SIMULATION,
273-
PLOT_TYPE_DATA,
274-
X_VALUES,
275-
X_OFFSET,
276-
X_LABEL,
277-
X_SCALE,
278-
Y_VALUES,
279-
Y_OFFSET,
280-
Y_LABEL,
281-
Y_SCALE,
282-
LEGEND_ENTRY,
283-
DATASET_ID,
284-
]
285-
286-
#: Visualization table columns
287-
VISUALIZATION_DF_COLS = [
288-
*VISUALIZATION_DF_REQUIRED_COLS,
289-
*VISUALIZATION_DF_OPTIONAL_COLS,
290-
]
291-
292-
#: Visualization table columns that contain subplot specifications
293-
VISUALIZATION_DF_SUBPLOT_LEVEL_COLS = [
294-
PLOT_ID,
295-
PLOT_NAME,
296-
PLOT_TYPE_SIMULATION,
297-
PLOT_TYPE_DATA,
298-
X_LABEL,
299-
X_SCALE,
300-
Y_LABEL,
301-
Y_SCALE,
302-
]
303-
304-
#: Visualization table columns that contain single plot specifications
305-
VISUALIZATION_DF_SINGLE_PLOT_LEVEL_COLS = [
306-
X_VALUES,
307-
X_OFFSET,
308-
Y_VALUES,
309-
Y_OFFSET,
310-
LEGEND_ENTRY,
311-
DATASET_ID,
312-
]
313-
314-
#: Plot type value in the visualization table for line plot
315-
LINE_PLOT = "LinePlot"
316-
#: Plot type value in the visualization table for bar plot
317-
BAR_PLOT = "BarPlot"
318-
#: Plot type value in the visualization table for scatter plot
319-
SCATTER_PLOT = "ScatterPlot"
320-
#: Supported plot types
321-
PLOT_TYPES_SIMULATION = [LINE_PLOT, BAR_PLOT, SCATTER_PLOT]
322-
323-
#: Supported xScales
324-
X_SCALES = [LIN, LOG, LOG10]
325-
326-
#: Supported yScales
327-
Y_SCALES = [LIN, LOG, LOG10]
328-
329-
330-
#: Plot type "data" value in the visualization table for mean and standard
331-
# deviation
332-
MEAN_AND_SD = "MeanAndSD"
333-
#: Plot type "data" value in the visualization table for mean and standard
334-
# error
335-
MEAN_AND_SEM = "MeanAndSEM"
336-
#: Plot type "data" value in the visualization table for replicates
337-
REPLICATE = "replicate"
338-
#: Plot type "data" value in the visualization table for provided noise values
339-
PROVIDED = "provided"
340-
#: Supported settings for handling replicates
341-
PLOT_TYPES_DATA = [MEAN_AND_SD, MEAN_AND_SEM, REPLICATE, PROVIDED]
342-
343-
344236
# YAML
345237
#: PEtab version key in the YAML file
346238
FORMAT_VERSION = "format_version"
@@ -388,8 +280,6 @@
388280
SIMULATION = "simulation"
389281
#: Residual value column in the residual table
390282
RESIDUAL = "residual"
391-
#: ???
392-
NOISE_VALUE = "noiseValue"
393283

394284
#: separator for multiple parameter values (bounds, observableParameters, ...)
395285
PARAMETER_SEPARATOR = ";"

petab/v2/lint.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
"CheckExperimentConditionsExist",
3636
"CheckAllParametersPresentInParameterTable",
3737
"CheckValidParameterInConditionOrParameterTable",
38-
"CheckVisualizationTable",
3938
"CheckUnusedExperiments",
4039
"CheckObservablesDoNotShadowModelEntities",
4140
"CheckUnusedConditions",
@@ -732,24 +731,6 @@ def run(self, problem: Problem) -> ValidationIssue | None:
732731
return None
733732

734733

735-
class CheckVisualizationTable(ValidationTask):
736-
"""A task to validate the visualization table of a PEtab problem."""
737-
738-
def run(self, problem: Problem) -> ValidationIssue | None:
739-
if problem.visualization_df is None:
740-
return None
741-
742-
from ..v1.visualize.lint import validate_visualization_df
743-
744-
if validate_visualization_df(problem):
745-
return ValidationIssue(
746-
level=ValidationIssueSeverity.ERROR,
747-
message="Visualization table is invalid.",
748-
)
749-
750-
return None
751-
752-
753734
class CheckPriorDistribution(ValidationTask):
754735
"""A task to validate the prior distribution of a PEtab problem."""
755736

@@ -1064,7 +1045,6 @@ def get_placeholders(
10641045
CheckUnusedExperiments(),
10651046
CheckUnusedConditions(),
10661047
# TODO: atomize checks, update to long condition table, re-enable
1067-
# CheckVisualizationTable(),
10681048
# TODO validate mapping table
10691049
CheckValidParameterInConditionOrParameterTable(),
10701050
CheckAllParametersPresentInParameterTable(),

petab/v2/petab1to2.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import re
66
import shutil
77
from contextlib import suppress
8-
from itertools import chain
98
from pathlib import Path
109
from tempfile import TemporaryDirectory
1110
from urllib.parse import urlparse
@@ -99,11 +98,9 @@ def petab_files_1to2(yaml_config: Path | str, output_dir: Path | str):
9998
file = yaml_config[v2.C.PARAMETER_FILE]
10099
v2.write_parameter_df(parameter_df, get_dest_path(file))
101100

102-
# copy files that don't need conversion
103-
# (models, visualizations)
104-
for file in chain(
105-
(model.location for model in new_yaml_config.model_files.values()),
106-
new_yaml_config.visualization_files,
101+
# copy files that don't need conversion: models
102+
for file in (
103+
model.location for model in new_yaml_config.model_files.values()
107104
):
108105
_copy_file(get_src_path(file), Path(get_dest_path(file)))
109106

@@ -289,7 +286,6 @@ def _update_yaml(yaml_config: dict) -> dict:
289286
v1.C.CONDITION_FILES,
290287
v1.C.MEASUREMENT_FILES,
291288
v1.C.OBSERVABLE_FILES,
292-
v1.C.VISUALIZATION_FILES,
293289
):
294290
if file_type in problem:
295291
yaml_config[file_type] = problem[file_type]

petab/v2/problem.py

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
validate_yaml_syntax,
2727
yaml,
2828
)
29-
from ..v1.core import concat_tables, get_visualization_df
29+
from ..v1.core import concat_tables
3030
from ..v1.distributions import Distribution
3131
from ..v1.models.model import Model, model_factory
3232
from ..v1.yaml import get_path_prefix
@@ -55,8 +55,6 @@ class Problem:
5555
- observable table
5656
- mapping table
5757
58-
Optionally, it may contain visualization tables.
59-
6058
See also :doc:`petab:v2/documentation_data_format`.
6159
"""
6260

@@ -69,7 +67,6 @@ def __init__(
6967
measurement_table: core.MeasurementTable = None,
7068
parameter_table: core.ParameterTable = None,
7169
mapping_table: core.MappingTable = None,
72-
visualization_df: pd.DataFrame = None,
7370
config: ProblemConfig = None,
7471
):
7572
from ..v2.lint import default_validation_tasks
@@ -97,8 +94,6 @@ def __init__(
9794
parameters=[]
9895
)
9996

100-
self.visualization_df = visualization_df
101-
10297
def __str__(self):
10398
model = f"with model ({self.model})" if self.model else "without model"
10499

@@ -257,15 +252,6 @@ def get_path(filename):
257252
else None
258253
)
259254

260-
# TODO: remove in v2?!
261-
visualization_files = [get_path(f) for f in config.visualization_files]
262-
# If there are multiple tables, we will merge them
263-
visualization_df = (
264-
concat_tables(visualization_files, get_visualization_df)
265-
if visualization_files
266-
else None
267-
)
268-
269255
observable_files = [get_path(f) for f in config.observable_files]
270256
# If there are multiple tables, we will merge them
271257
observable_df = (
@@ -289,7 +275,6 @@ def get_path(filename):
289275
parameter_df=parameter_df,
290276
observable_df=observable_df,
291277
model=model,
292-
visualization_df=visualization_df,
293278
mapping_df=mapping_df,
294279
config=config,
295280
)
@@ -301,7 +286,6 @@ def from_dfs(
301286
experiment_df: pd.DataFrame = None,
302287
measurement_df: pd.DataFrame = None,
303288
parameter_df: pd.DataFrame = None,
304-
visualization_df: pd.DataFrame = None,
305289
observable_df: pd.DataFrame = None,
306290
mapping_df: pd.DataFrame = None,
307291
config: ProblemConfig = None,
@@ -315,7 +299,6 @@ def from_dfs(
315299
measurement_df: PEtab measurement table
316300
parameter_df: PEtab parameter table
317301
observable_df: PEtab observable table
318-
visualization_df: PEtab visualization table
319302
mapping_df: PEtab mapping table
320303
model: The underlying model
321304
config: The PEtab problem configuration
@@ -336,7 +319,6 @@ def from_dfs(
336319
measurement_table=measurement_table,
337320
parameter_table=parameter_table,
338321
mapping_table=mapping_table,
339-
visualization_df=visualization_df,
340322
config=config,
341323
)
342324

@@ -1117,8 +1099,7 @@ def model_dump(self, **kwargs) -> dict[str, Any]:
11171099
'measurement_files': [],
11181100
'model_files': {},
11191101
'observable_files': [],
1120-
'parameter_file': [],
1121-
'visualization_files': []},
1102+
'parameter_file': []},
11221103
'experiments': [],
11231104
'mappings': [],
11241105
'measurements': [],
@@ -1191,7 +1172,6 @@ class ProblemConfig(BaseModel):
11911172
condition_files: list[str | AnyUrl] = []
11921173
experiment_files: list[str | AnyUrl] = []
11931174
observable_files: list[str | AnyUrl] = []
1194-
visualization_files: list[str | AnyUrl] = []
11951175
mapping_files: list[str | AnyUrl] = []
11961176

11971177
#: Extensions used by the problem.

0 commit comments

Comments
 (0)