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
DM-23032: CreateSDM functor for bitpacking mutiple flag columns #107
Conversation
Debug bitpacking and unittests.
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.
Looks good. I had a few very minor comments.
for table in table_list: | ||
if table['tableName'] == 'DiaSource': | ||
self.bit_pack_columns = table['columns'] | ||
break |
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.
Do you need the for
loop here, since you're just iterating through until you find the table with the correct name?
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.
Considering the yaml file could have flags for different tables (DiaObject, SSObject) and no enforced ordering, it makes sense to just go through the named tables and load the one we want.
Parameters | ||
---------- | ||
input_flag_values : array-like of type uint | ||
Input integer flags to unpack. |
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.
"Input" does not need to be capitalized.
output_flags = np.zeros(len(input_flag_values), dtype=bit_names_types) | ||
|
||
for bit_idx, (bit_name, dtypes) in enumerate(bit_names_types): | ||
masked_bits = np.bitwise_and(input_flag_values, 2 ** bit_idx) |
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.
Remove spaces in 2 ** bit_idx
self.exposure, self.inputCatalog = dataset.realize(10.0, schema, randomSeed=1234) | ||
# Make up expected task inputs. |
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.
Could you please re-word this comment? I find the meaning ambiguous.
No description provided.