-
Notifications
You must be signed in to change notification settings - Fork 1
Implement CSV download #86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
RemDelaporteMathurin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this locally and confirm the data can be downloaded (tested on chrome) and plotted without issue.
I just have a few requests (see comments below)
src/backend.py
Outdated
| csv_payload = { | ||
| "time": [], | ||
| "series": {} | ||
| } | ||
| max_len = 0 | ||
| for scope in scopes: | ||
| time, values = scope.read() | ||
| max_len = max(max_len, len(time)) | ||
| csv_payload["time"] = time.tolist() | ||
| for i, series in enumerate(values): | ||
| label = scope.labels[i] if i < len(scope.labels) else f"{scope.label} {i}" | ||
| csv_payload["series"][label] = series.tolist() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be its own function make_csv_payload(scopes) that can then be tested in the CI
RemDelaporteMathurin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, we can probably work later on making the results graph a bit smaller in some cases. Feel free to merge it if you're happy with it
No description provided.