Skip to content

Add total_nodes method to TreeMeshes#324

Merged
jcapriot merged 5 commits intosimpeg:mainfrom
santisoler:all-nodes
Jun 4, 2023
Merged

Add total_nodes method to TreeMeshes#324
jcapriot merged 5 commits intosimpeg:mainfrom
santisoler:all-nodes

Conversation

@santisoler
Copy link
Member

The new method returns the whole set of nodes in the mesh, including non-hanging and hanging nodes. It comes useful when working together with cell_nodes.

The new property returns the location of all non hanging and hanging
nodes.
@santisoler santisoler requested a review from jcapriot June 1, 2023 22:24
@jcapriot
Copy link
Member

jcapriot commented Jun 2, 2023

This should probably be called total_nodes to follow the naming convention already in the tree mesh: nodes, hanging_nodes, n_nodes, n_hanging_nodes and n_total_nodes.

@santisoler
Copy link
Member Author

I agree that it should follow the convention used on the other methods, so I think it's better to rename it.

Nevertheless, I think is nice to name things like nodes_all, nodes_hanging, nodes_non_hanging for easier discoverability: they'll be listed together in the docs, users can use tab completion to explore what properties and methods are available for nodes.... Just mentioning to keep it in mind for the future.

@santisoler santisoler changed the title Add nodes_all method to TreeMeshes Add total_nodes method to TreeMeshes Jun 2, 2023
@codecov
Copy link

codecov bot commented Jun 2, 2023

Codecov Report

Merging #324 (327ccc2) into main (ee39262) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main     #324   +/-   ##
=======================================
  Coverage   85.15%   85.16%           
=======================================
  Files          38       38           
  Lines       11535    11538    +3     
=======================================
+ Hits         9823     9826    +3     
  Misses       1712     1712           
Impacted Files Coverage Δ
discretize/_extensions/tree_ext.pyx 84.44% <ø> (ø)
discretize/tree_mesh.py 71.19% <100.00%> (+0.20%) ⬆️


Returns
-------
(n_nodes + n_hanging_nodes, dim) numpy.ndarray of float
Copy link
Member

@jcapriot jcapriot Jun 3, 2023

Choose a reason for hiding this comment

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

n_total_nodes

@jcapriot jcapriot merged commit 8e15c7a into simpeg:main Jun 4, 2023
@santisoler santisoler deleted the all-nodes branch June 5, 2023 16:26
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.

2 participants