Skip to content

Conversation

@fyffep
Copy link
Collaborator

@fyffep fyffep commented May 26, 2025

@fyffep fyffep changed the title Create NumPy Field Manipulation doc Release Version 4.7 (NumPy Field Manipulation and more) May 26, 2025
<Steppable Type="FieldManager">
<Field Name="fibers_field_manager" Type="vector"/>
<Field Name="numpy_field_manager" Type="scalar"/>
<Field Name="cell_type_field" Type="scalar" Precision="uchar"/>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's replace uchar with uint8 - for consistency - uchar will not work when you create a field using Python Steppable API, but uint8 will.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Fixed.

self.copy_cell_attribute_field_values_to("cell_type_field", "type")
self.copy_cell_attribute_field_values_to("cell_volume_field", "id")

These populate the NumPy fields with values derived from cell attributes. However, the NumPy data must then be copied back manually to the cells.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's rephrase it as follows:
However, the NumPy data must then be copied back manually to the cells - if your workflow requires transfer of data from numpy arrays to cells

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree! This is more clear.

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.

3 participants