-
Notifications
You must be signed in to change notification settings - Fork 8
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
Cu mixd io / typo fixes #214
base: main
Are you sure you want to change the base?
Conversation
WalkthroughThe recent updates to the codebase focus on refining data processing and export functionalities. Key enhancements involve iterating over correct dictionary structures, standardizing endianness handling, optimizing file writing operations, and adjusting argument orders for export functions to enhance code consistency and maintainability. Changes
Poem
Tip Early access features: enabledWe are currently testing the following features in early access:
Note:
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Files selected for processing (2)
- gustaf/helpers/options.py (1 hunks)
- gustaf/io/mixd.py (6 hunks)
Additional comments not posted (13)
gustaf/io/mixd.py (12)
18-19
: LGTM!The introduction of
_big_endian_int
and_big_endian_double
constants ensures consistent endianness handling.
79-79
: Ensure consistent endianness handling for vertices.The dtype parameter for
np.fromfile
has been updated to use_big_endian_double
, ensuring consistent endianness handling for vertices.
84-86
: Ensure consistent endianness handling for connectivity.The dtype parameter for
np.fromfile
has been updated to use_big_endian_int
, ensuring consistent endianness handling for connectivity.
93-93
: Ensure consistent endianness handling for boundary conditions.The dtype parameter for
np.fromfile
has been updated to use_big_endian_int
, ensuring consistent endianness handling for boundary conditions.
123-130
: LGTM!The
_ravel
function is a useful helper for array manipulation.
132-144
: LGTM!The
_write_raveled_int
function ensures consistent endianness handling for integer data.
146-158
: LGTM!The
_write_raveled_double
function ensures consistent endianness handling for double data.
224-224
: Ensure consistent endianness handling for vertex data.The vertex data is now written using
_write_raveled_double
, ensuring consistent endianness handling.
229-229
: Ensure consistent endianness handling for space-time vertex data.The space-time vertex data is now written using
_write_raveled_double
, ensuring consistent endianness handling.
233-234
: Ensure consistent endianness handling for connectivity data.The connectivity data is now written using
_write_raveled_int
, ensuring consistent endianness handling.
241-241
: Ensure consistent endianness handling for boundary conditions.The boundary conditions are now written using
_write_raveled_int
, ensuring consistent endianness handling.
288-288
: Ensure consistent endianness handling for dual information.The dual information is now written using
_write_raveled_int
, ensuring consistent endianness handling.gustaf/helpers/options.py (1)
278-278
: Fix iteration over valid options.The loop iteration has been correctly updated to
_valid_options.values()
.
So some of the examples are failing. specifically export_meshio and mixd_to_nutils. I will quickly check what the issue is. |
…uring original PR for this.
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.
Actionable comments posted: 2
Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Files selected for processing (2)
- examples/export_meshio.py (1 hunks)
- examples/mixd_to_nutils.py (1 hunks)
Additional comments not posted (2)
examples/mixd_to_nutils.py (1)
11-12
: Verify the argument order in export function calls.Ensure that the
export
function ingus.io.mixd
andgus.io.nutils
modules accepts arguments in the order(filename, mesh)
.Verification successful
The argument order in export function calls is correct.
The
export
function definitions ingustaf/io/mixd.py
andgustaf/io/nutils.py
accept arguments in the order(fname, mesh)
, which matches the usage inexamples/mixd_to_nutils.py
.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the argument order in export function calls. # Test: Search for the `export` function definitions. Expect: The argument order should be `(filename, mesh)`. rg --type python 'def export' | rg 'export\(filename, mesh\)'Length of output: 94
Script:
#!/bin/bash # Description: Verify the argument order in export function calls. # Test: Search for the `export` function definitions. Expect: The argument order should be `(filename, mesh)`. rg 'def export' | rg 'export\(filename, mesh\)'Length of output: 49
Script:
#!/bin/bash # Description: Verify the argument order in export function calls. # Test: Search for all `export` function definitions and display their argument lists. rg 'def export'Length of output: 206
examples/export_meshio.py (1)
47-47
: Verify the argument order in export function calls.Ensure that the
export
function ingus.io.meshio
module accepts arguments in the order(mesh, export_path)
.
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.
With the example fix, I see no Problems. Since I am not using mixd heavily, I can not say anything application-specific, but it looks good. Thank you for your work.
This PR create an internal-use function to write a big endian file. It doesn't need to be part of API, just useful if you have extra arrays to export, e.g.,
mprd
.Also, typo fixes
Summary by CodeRabbit
Bug Fixes
New Features
Refactor
Examples