Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PI Problem Database
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Marek Wiesner
PI Problem Database
Commits
340e5774
Commit
340e5774
authored
11 months ago
by
Marek Wiesner
Browse files
Options
Downloads
Patches
Plain Diff
Fix checks for None
parent
a56d960c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
scripts/get_constraints_status.py
+2
-2
2 additions, 2 deletions
scripts/get_constraints_status.py
scripts/src/read_dataset.py
+1
-1
1 addition, 1 deletion
scripts/src/read_dataset.py
scripts/src/to_cpp.py
+1
-1
1 addition, 1 deletion
scripts/src/to_cpp.py
with
4 additions
and
4 deletions
scripts/get_constraints_status.py
+
2
−
2
View file @
340e5774
...
...
@@ -53,7 +53,7 @@ def get_constraints_status(modelFileName: Path, dataset: Dataset) -> tuple[bool,
logging
.
warning
(
f
"
{
dataset
.
name
}
:
{
err
}
. Indicate parsing error and return invalid constraints status.
"
)
return
readingPcompModelWasNotSuccessfulFlag
,
False
assert
pcompModel
.
functions
.
constraints
assert
pcompModel
.
functions
.
constraints
is
not
None
if
any_function_contains_symbols
(
pcompModel
.
functions
.
constraints
,
pcompModel
.
variables
.
states
):
logging
.
warning
(
f
"
{
dataset
.
name
}
: Constraints depend on states. Return invalid constraints status.
"
)
...
...
@@ -63,7 +63,7 @@ def get_constraints_status(modelFileName: Path, dataset: Dataset) -> tuple[bool,
logging
.
warning
(
f
"
{
dataset
.
name
}
: Constraints depend on time. Return invalid constraints status.
"
)
return
readingPcompModelWasSuccessfulFlag
,
False
if
(
pcompModel
.
variables
.
concentration
if
(
pcompModel
.
variables
.
concentration
is
not
None
and
any_function_contains_symbols
(
pcompModel
.
functions
.
constraints
,
[
pcompModel
.
variables
.
concentration
])):
logging
.
warning
(
f
"
{
dataset
.
name
}
: Constraints depend on concentration. Return invalid constraints status.
"
)
return
readingPcompModelWasSuccessfulFlag
,
False
...
...
This diff is collapsed.
Click to expand it.
scripts/src/read_dataset.py
+
1
−
1
View file @
340e5774
...
...
@@ -254,7 +254,7 @@ def read_measurements_to_dataset(linesIt: Iterator[str], dataset: Dataset) -> It
timePoints
.
append
(
values
[
0
])
if
hasConcentration
:
if
concentrationValue
:
if
concentrationValue
is
not
None
:
if
concentrationValue
!=
values
[
1
]:
raise
MeasurementInconsistencyError
(
f
"
{
dataset
.
name
}
: Measurements dimensions inconsistent
"
)
else
:
...
...
This diff is collapsed.
Click to expand it.
scripts/src/to_cpp.py
+
1
−
1
View file @
340e5774
...
...
@@ -29,7 +29,7 @@ def to_cpp_array_of_constraints_infos(constraintsInfos: List[ConstraintInfo]) ->
def
to_cpp_optional
(
value
:
Optional
[
float
])
->
str
:
if
not
value
:
if
valu
e
is
Non
e
:
return
"
{}
"
return
f
"
{
value
}
"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment