Skip to content
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

Merged
merged 3 commits into from Mar 30, 2021

Conversation

morriscb
Copy link
Contributor

No description provided.

Copy link
Contributor

@isullivan isullivan left a 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.

Comment on lines +115 to +118
for table in table_list:
if table['tableName'] == 'DiaSource':
self.bit_pack_columns = table['columns']
break
Copy link
Contributor

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?

Copy link
Contributor Author

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.
Copy link
Contributor

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)
Copy link
Contributor

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.
Copy link
Contributor

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.

@morriscb morriscb merged commit 5212702 into master Mar 30, 2021
@morriscb morriscb deleted the tickets/DM-23032 branch March 30, 2021 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants