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

Release 0.0.0a17 #173

Merged
merged 17 commits into from
Dec 4, 2019
Merged
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix(lint) correct handling of optional columns. Check before access.
  • Loading branch information
dweindl committed Dec 3, 2019
commit 5dce8d24ca2fe19518b559aded6fd21af5e04535
19 changes: 14 additions & 5 deletions petab/lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,26 @@ def check_condition_df(df: pd.DataFrame, sbml_model: libsbml.Model):


def check_measurement_df(df):
req_cols = [
"observableId", "preequilibrationConditionId", "simulationConditionId",
"measurement", "time", "observableParameters", "noiseParameters"
required_columns = [
"observableId", "simulationConditionId", "measurement", "time"
]
optional_columns = [
"preequilibrationConditionId",
"observableParameters", "noiseParameters"
]

for column_name in req_cols:
_check_df(df, required_columns, "measurement")

for column_name in required_columns:
if not np.issubdtype(df[column_name].dtype, np.number):
assert_no_leading_trailing_whitespace(
df[column_name].values, column_name)

_check_df(df, req_cols, "measurement")
for column_name in optional_columns:
if column_name in df \
and not np.issubdtype(df[column_name].dtype, np.number):
assert_no_leading_trailing_whitespace(
df[column_name].values, column_name)


def check_parameter_df(
Expand Down