Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openstructure
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
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
schwede
openstructure
Commits
3219b797
Commit
3219b797
authored
1 year ago
by
Studer Gabriel
Browse files
Options
Downloads
Patches
Plain Diff
compare-structures: avoid writing NaN to JSON
parent
abd42376
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
actions/ost-compare-structures
+2
-1
2 additions, 1 deletion
actions/ost-compare-structures
with
2 additions
and
1 deletion
actions/ost-compare-structures
+
2
−
1
View file @
3219b797
...
...
@@ -81,6 +81,7 @@ import json
import time
import sys
import traceback
import math
from ost import io
from ost.mol.alg import scoring
...
...
@@ -497,7 +498,7 @@ def _ParseArgs():
def _RoundOrNone(num, decimals = 3):
""" Helper to create valid JSON output
"""
if num is None:
if num is None
or math.isnan(num) or math.isinf(num)
:
return None
return round(num, decimals)
...
...
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