-
Notifications
You must be signed in to change notification settings - Fork 6
fix d(SdW/dxj)/dxj processing #245
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1029,23 +1029,23 @@ def compute_and_write_additional_sstat_fields( | |
| field_name="SdWdx", | ||
| file_type="fld", | ||
| file_name=full_fname_stat, | ||
| file_key=file_keys_UidSdxj[6], | ||
| file_key=file_keys_SdUidxj[6], | ||
| dtype=np.single, | ||
| ) | ||
| stat_fields.add_field( | ||
| comm, | ||
| field_name="SdWdy", | ||
| file_type="fld", | ||
| file_name=full_fname_stat, | ||
| file_key=file_keys_UidSdxj[7], | ||
| file_key=file_keys_SdUidxj[7], | ||
|
||
| dtype=np.single, | ||
| ) | ||
| stat_fields.add_field( | ||
| comm, | ||
| field_name="SdWdz", | ||
| file_type="fld", | ||
| file_name=full_fname_stat, | ||
| file_key=file_keys_UidSdxj[8], | ||
| file_key=file_keys_SdUidxj[8], | ||
|
||
| dtype=np.single, | ||
| ) | ||
|
|
||
|
|
||
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.
These hard-coded indices (6/7/8) are magic numbers and are easy to mis-map (which appears to be what happened previously for the
SdW*d*fields). Consider replacing them with named constants (e.g.,SDWDX_KEY_IDX = 6, etc.) or a small mapping (e.g.,{'SdWdx': ..., 'SdWdy': ..., 'SdWdz': ...}) so it’s explicit which component each key refers to and reduces the chance of future index mistakes.