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
Commits
de15b4a9
Commit
de15b4a9
authored
6 years ago
by
Jeremy M Fee
Committed by
Claycomb, Abram Earl
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix linting errors
parent
aee0c3ff
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
geomagio/TimeseriesFactory.py
+2
-0
2 additions, 0 deletions
geomagio/TimeseriesFactory.py
geomagio/WebService.py
+3
-0
3 additions, 0 deletions
geomagio/WebService.py
geomagio/algorithm/SqDistAlgorithm.py
+2
-2
2 additions, 2 deletions
geomagio/algorithm/SqDistAlgorithm.py
with
7 additions
and
2 deletions
geomagio/TimeseriesFactory.py
+
2
−
0
View file @
de15b4a9
...
@@ -110,6 +110,8 @@ class TimeseriesFactory(object):
...
@@ -110,6 +110,8 @@ class TimeseriesFactory(object):
try
:
try
:
data
=
Util
.
read_url
(
url
)
data
=
Util
.
read_url
(
url
)
except
IOError
as
e
:
except
IOError
as
e
:
print
(
"
Error reading url: %s, continuing
"
%
str
(
e
),
file
=
sys
.
stderr
)
continue
continue
try
:
try
:
timeseries
+=
self
.
parse_string
(
data
,
timeseries
+=
self
.
parse_string
(
data
,
...
...
This diff is collapsed.
Click to expand it.
geomagio/WebService.py
+
3
−
0
View file @
de15b4a9
...
@@ -6,6 +6,7 @@ from cgi import escape, parse_qs
...
@@ -6,6 +6,7 @@ from cgi import escape, parse_qs
from
collections
import
OrderedDict
from
collections
import
OrderedDict
from
datetime
import
datetime
from
datetime
import
datetime
from
json
import
dumps
from
json
import
dumps
import
sys
from
geomagio.edge
import
EdgeFactory
from
geomagio.edge
import
EdgeFactory
from
geomagio.iaga2002
import
IAGA2002Writer
from
geomagio.iaga2002
import
IAGA2002Writer
...
@@ -109,6 +110,8 @@ class WebService(object):
...
@@ -109,6 +110,8 @@ class WebService(object):
if
isinstance
(
timeseries_string
,
str
):
if
isinstance
(
timeseries_string
,
str
):
timeseries_string
=
timeseries_string
.
encode
(
'
utf8
'
)
timeseries_string
=
timeseries_string
.
encode
(
'
utf8
'
)
except
Exception
as
e
:
except
Exception
as
e
:
print
(
"
Error processing request: %s
"
%
str
(
e
),
file
=
sys
.
stderr
)
message
=
"
Server error.
"
message
=
"
Server error.
"
error_body
=
self
.
error
(
500
,
message
,
environ
,
start_response
)
error_body
=
self
.
error
(
500
,
message
,
environ
,
start_response
)
return
[
error_body
]
return
[
error_body
]
...
...
This diff is collapsed.
Click to expand it.
geomagio/algorithm/SqDistAlgorithm.py
+
2
−
2
View file @
de15b4a9
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
Use of fmin_l_bfgs_b to estimate parameters inspired by Andre Queiroz:
Use of fmin_l_bfgs_b to estimate parameters inspired by Andre Queiroz:
https://gist.github.com/andrequeiroz/5888967
https://gist.github.com/andrequeiroz/5888967
"""
"""
from
__future__
import
absolute_import
from
__future__
import
absolute_import
,
print_function
from
..
import
StreamConverter
from
..
import
StreamConverter
from
.Algorithm
import
Algorithm
from
.Algorithm
import
Algorithm
...
@@ -82,7 +82,7 @@ class SqDistAlgorithm(Algorithm):
...
@@ -82,7 +82,7 @@ class SqDistAlgorithm(Algorithm):
# state is up to date, only need new data
# state is up to date, only need new data
return
(
start
,
end
)
return
(
start
,
end
)
# state not up to date, need to prime
# state not up to date, need to prime
print
(
'
WARNING: missing or incompatible state...
'
+
\
print
(
'
WARNING: missing or incompatible state...
'
+
'
reinitializing.
'
,
file
=
sys
.
stderr
)
'
reinitializing.
'
,
file
=
sys
.
stderr
)
return
(
start
-
3
*
30
*
24
*
60
*
60
,
end
)
return
(
start
-
3
*
30
*
24
*
60
*
60
,
end
)
...
...
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