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
Strax output for pax #720
Strax output for pax #720
Conversation
Flake8 detected 34 issues on ed8d3c9 |
pax/data_model.py
Outdated
@@ -189,6 +189,9 @@ def to_bson(self, fields_to_ignore=None, nan_to_none=False): | |||
return bson.BSON.encode(self.to_dict(convert_numpy_arrays_to='bytes', | |||
fields_to_ignore=fields_to_ignore, | |||
nan_to_none=nan_to_none)) | |||
|
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.
[Flake8]
[W293] blank line contains whitespace
pax/plugins/io/strax.py
Outdated
|
||
def open(self, filename): | ||
self.current_file = open(filename, mode='wb') | ||
|
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.
[Flake8]
[W293] blank line contains whitespace
pax/plugins/io/strax.py
Outdated
from pax.FolderIO import WriteToFolder | ||
|
||
class WriteStrax(WriteToFolder): | ||
|
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.
[Flake8]
[W293] blank line contains whitespace
pax/plugins/io/strax.py
Outdated
|
||
def close(self): | ||
self.current_file.close() | ||
|
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.
[Flake8]
[W293] blank line contains whitespace
pax/plugins/io/strax.py
Outdated
class WriteStrax(WriteToFolder): | ||
|
||
|
||
"""Write raw data to a folder of strax files |
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.
[Flake8]
[E303] too many blank lines (2)
pax/plugins/io/strax_functions.py
Outdated
for rec_i in range(n_records): | ||
r = records[output_record_index] | ||
r['time'] = (self.start_time | ||
+ p.left * 10 |
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.
[Flake8]
[W291] trailing whitespace
pax/plugins/io/strax_functions.py
Outdated
def pax_to_records(self, samples_per_record=110, events_per_chunk=10): | ||
results = [] | ||
samples_per_record = 110 | ||
|
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.
[Flake8]
[W293] blank line contains whitespace
pax/plugins/io/strax_functions.py
Outdated
n_records = records_needed(p.length, samples_per_record) | ||
for rec_i in range(n_records): | ||
r = records[output_record_index] | ||
r['time'] = (self.start_time |
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.
[Flake8]
[W291] trailing whitespace
pax/plugins/io/strax_functions.py
Outdated
# There's more chunks coming, so we store a full chunk | ||
n_store = samples_per_record | ||
if not condition: p.length > samples_per_record * (rec_i + 1) | ||
raise AssertionError() |
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.
[Flake8]
[E113] unexpected indentation
pax/plugins/io/strax_functions.py
Outdated
# There's more chunks coming, so we store a full chunk | ||
n_store = samples_per_record | ||
if not condition: p.length > samples_per_record * (rec_i + 1) | ||
raise AssertionError() |
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.
[Flake8]
[E999] IndentationError: unexpected indent
pax/plugins/io/strax_functions.py
Outdated
if rec_i != n_records - 1: | ||
# There's more chunks coming, so we store a full chunk | ||
n_store = samples_per_record | ||
if not condition: p.length > samples_per_record * (rec_i + 1) |
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.
[Flake8]
[E701] multiple statements on one line (colon)
pax/plugins/io/strax_functions.py
Outdated
# (that would be zero if we have to store a full record) | ||
n_store = p.length - samples_per_record * rec_i | ||
|
||
if not condition: 0 <= n_store <= samples_per_record |
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.
[Flake8]
[E701] multiple statements on one line (colon)
pax/plugins/io/strax_functions.py
Outdated
n_store = p.length - samples_per_record * rec_i | ||
|
||
if not condition: 0 <= n_store <= samples_per_record | ||
raise AssertionError() |
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.
[Flake8]
[E113] unexpected indentation
Can you add a few sentences in the description above and remove the general stuff about how to make a pull request? See another pull request for an example. @petergaemers |
@tunnell @JelleAalbers Would you like to update the review status so that we can decide when to merge it? At a later stage more analyzers can use this to learn Strax. |
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.
It's fine. Does not affect 1T.
Added files for plugin to let pax output numpy arrays in strax format.
Strax uses a different output then is done by pax. This plugin gives pax the possibility to write numpy arrays as output in the format required for loading records in Strax.
To use set --output_type strax
In paxer added a line to include the WriteStrax class.
In data_model added a to_strax function
strax.py contains the WriteStrax class
strax_functions contain the functions converting to the strax format.