Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/changelog.d/4257.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Filter non-numeric values when parsing item list
3 changes: 2 additions & 1 deletion src/ansys/mapdl/core/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@

from ansys.mapdl.core import Mapdl
from ansys.mapdl.core.errors import ComponentDoesNotExits, ComponentIsNotSelected
from ansys.mapdl.core.misc import is_float

if TYPE_CHECKING: # pragma: no cover
import logging
Expand Down Expand Up @@ -577,7 +578,7 @@ def _parse_cmlist_indiv(

# Joining them together and giving them format.
items = items.replace("\n", " ").split()
items = [int(each) for each in items]
items = [int(each) for each in items if is_float(each)]

return items

Expand Down
16 changes: 16 additions & 0 deletions tests/test_component.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,3 +392,19 @@ def test_dunder_methods_len(mapdl, basic_components):
mapdl.nsel("s", vmin=1)
mapdl.cm("asdf", "node")
assert len(mapdl.components) == 4


def test_big_component(mapdl, cleared):
mapdl.prep7()

for i in range(1000):
mapdl.n(i, i, 0, 0)

mapdl.allsel()
mapdl.cm("many_nodes", "NODE")

print(mapdl.mesh) # This will trigger COMP parsing

assert "MANY_NODES" in str(mapdl.components)
assert len(mapdl.components["many_nodes"]) == 999
assert all(isinstance(item, int) for item in mapdl.components["many_nodes"])
Loading