Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MetObsAPI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MetObs
MetObsAPI
Commits
f839313f
Unverified
Commit
f839313f
authored
Apr 12, 2017
by
David Hoese
Browse files
Options
Downloads
Patches
Plain Diff
Fix 'sep' in CSV data api output
parent
dd491cb7
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
metobsapi/data_api.py
+3
-2
3 additions, 2 deletions
metobsapi/data_api.py
metobsapi/templates/data_index.html
+1
-1
1 addition, 1 deletion
metobsapi/templates/data_index.html
with
4 additions
and
3 deletions
metobsapi/data_api.py
+
3
−
2
View file @
f839313f
...
@@ -134,12 +134,12 @@ def handle_csv(frame, epoch, sep=',',
...
@@ -134,12 +134,12 @@ def handle_csv(frame, epoch, sep=',',
# code: {code:d}
# code: {code:d}
# message: {message}
# message: {message}
# num_results: {num_results:d}
# num_results: {num_results:d}
# fields: {epoch_str}
,
{symbol_list}
# fields: {epoch_str}
{sep}
{symbol_list}
{symbol_data}
{symbol_data}
"""
"""
data_lines
=
[]
data_lines
=
[]
line_format
=
"
{time}
,
{symbols}
"
line_format
=
sep
.
join
([
"
{time}
"
,
"
{symbols}
"
])
for
t
,
row
in
frame
.
iterrows
():
for
t
,
row
in
frame
.
iterrows
():
line
=
line_format
.
format
(
line
=
line_format
.
format
(
time
=
t
,
time
=
t
,
...
@@ -152,6 +152,7 @@ def handle_csv(frame, epoch, sep=',',
...
@@ -152,6 +152,7 @@ def handle_csv(frame, epoch, sep=',',
epoch_str
=
data_responses
.
epoch_translation
[
epoch
]
+
'
since epoch (1970-01-01 00:00:00)
'
epoch_str
=
data_responses
.
epoch_translation
[
epoch
]
+
'
since epoch (1970-01-01 00:00:00)
'
output
=
output
.
format
(
output
=
output
.
format
(
sep
=
sep
,
status
=
status
,
status
=
status
,
code
=
code
,
code
=
code
,
message
=
message
,
message
=
message
,
...
...
This diff is collapsed.
Click to expand it.
metobsapi/templates/data_index.html
+
1
−
1
View file @
f839313f
...
@@ -192,7 +192,7 @@
...
@@ -192,7 +192,7 @@
<b>
sep:
</b>
<b>
sep:
</b>
</td>
</td>
<td
style=
'padding: 6px;'
>
<td
style=
'padding: 6px;'
>
The separator to use between each data point. Works with
csv
and XML formats. By default, the separator is a ','.
The separator to use between each data point. Works with
CSV
and XML formats. By default, the separator is a ','.
</td>
</td>
</tr>
</tr>
<tr>
<tr>
...
...
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
sign in
to comment