Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
geomag-algorithms
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
ghsc
National Geomagnetism Program
geomag-algorithms
Merge requests
!148
Scale value error
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Scale value error
ghsc/users/pcain/geomag-algorithms:scale-value-error
into
master
Overview
2
Commits
1
Pipelines
0
Changes
2
All threads resolved!
Hide all comments
Merged
Cain, Payton David
requested to merge
ghsc/users/pcain/geomag-algorithms:scale-value-error
into
master
3 years ago
Overview
2
Commits
1
Pipelines
0
Changes
2
All threads resolved!
Hide all comments
Expand
Fixes
#59 (closed)
0
0
Merge request reports
Compare
master
version 6
e9b8bb84
3 years ago
version 5
3577aee5
3 years ago
version 4
797e75dc
3 years ago
version 3
10194407
3 years ago
version 2
93c52602
3 years ago
version 1
7ae88326
3 years ago
master (base)
and
latest version
latest version
c4c4855d
1 commit,
3 years ago
version 6
e9b8bb84
1 commit,
3 years ago
version 5
3577aee5
1 commit,
3 years ago
version 4
797e75dc
1 commit,
3 years ago
version 3
10194407
2 commits,
3 years ago
version 2
93c52602
2 commits,
3 years ago
version 1
7ae88326
2 commits,
3 years ago
2 files
+
7
−
5
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
geomagio/api/ws/algorithms.py
+
6
−
3
Options
from
os
import
name
import
json
from
fastapi
import
APIRouter
,
Depends
,
HTTPException
from
starlette.responses
import
Response
from
...
import
TimeseriesFactory
from
...algorithm
import
DbDtAlgorithm
from
...residual
import
(
calculate
,
@@ -44,6 +44,9 @@ def get_dbdt(
)
def
calculate_residual
(
reading
:
Reading
,
adjust_reference
:
bool
=
True
):
try
:
return
calculate
(
reading
=
reading
,
adjust_reference
=
adjust_reference
)
calculated
=
calculate
(
reading
=
reading
,
adjust_reference
=
adjust_reference
).
json
()
return
json
.
loads
(
calculated
.
replace
(
"
NaN
"
,
"
null
"
))
except
ValueError
as
e
:
raise
HTTPException
(
status_code
=
400
,
detail
=
str
(
e
))
Loading