Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into refactor/component-te…
Browse files Browse the repository at this point in the history
…sting-into-classes
  • Loading branch information
germa89 committed Jan 17, 2025
2 parents f3134ee + 0f1e0ec commit 8033fb4
Show file tree
Hide file tree
Showing 12 changed files with 45 additions and 9 deletions.
10 changes: 10 additions & 0 deletions .ci/build_matrix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ LATEST=3 # for 'latest-ubuntu' and 'latest-ubuntu-student'
# Run only ubuntu jobs
ONLY_UBUNTU="${ONLY_UBUNTU:-false}"

# On remote
ON_REMOTE="${ON_REMOTE:-false}"

# Do not process more than the $AUTH_USER_LIMIT_VERSIONS versions in above list
AUTH_USER_LIMIT_VERSIONS="${AUTH_USER_LIMIT_VERSIONS:-2}"
AUTH_USER_LIMIT=$((LATEST+AUTH_USER_LIMIT_VERSIONS*3))
Expand Down Expand Up @@ -97,6 +100,13 @@ for version in "${versions[@]}"; do
continue
fi

# Skipping if on remote and on student
if [[ "$ON_STUDENT" == "true" && "$ON_REMOTE" == "true" ]]; then
echo "Skipping student versions when running on remote"
echo ""
continue
fi

# Skipping student versions on auth_user
# if [[ "$auth_user" == "true" && "$ON_STUDENT" == "true" ]]; then
# echo "Skipping student versions when user is authenticated"
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ env:
ON_CI: True
PYTEST_ARGUMENTS: '-vvv -rxXsa --color=yes --durations=10 --random-order --random-order-bucket=class --maxfail=10 --reruns 3 --reruns-delay 4 --cov=ansys.mapdl.core --cov-report=html --timeout=180'


BUILD_CHEATSHEET: True
PYMAPDL_DEBUG_TESTING: True

Expand Down Expand Up @@ -396,6 +395,7 @@ jobs:
env:
extended_testing: ${{ github.event_name == 'schedule' || ( github.event_name == 'workflow_dispatch' && inputs.run_all_tests ) || ( github.event_name == 'push' && contains(github.ref, 'refs/tags') ) }}
auth_user: ${{ steps.is_organization_member.outputs.isTeamMember == 'true' || github.actor == 'dependabot[bot]' }}
ON_REMOTE: true
run: .ci/build_matrix.sh

build-test-remote:
Expand Down Expand Up @@ -787,11 +787,12 @@ jobs:
name: "Local-min: ${{ matrix.mapdl-version }}"
runs-on: ubuntu-22.04
if: github.ref != 'refs/heads/main' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
needs: [smoke-tests, build-test-local-minimal-matrix]
needs: [build-test-ubuntu-local, build-test-remote]
timeout-minutes: 75
strategy:
fail-fast: false
matrix: ${{fromJson(needs.build-test-local-minimal-matrix.outputs.matrix)}}
matrix:
mapdl-version: ['latest-ubuntu', 'v25.1-ubuntu']
container:
image: ghcr.io/ansys/mapdl:${{ matrix.mapdl-version }}
options: -u=0:0 --oom-kill-disable --memory=6656MB --memory-swap=16896MB --shm-size=1gb --entrypoint /bin/bash
Expand Down Expand Up @@ -915,11 +916,12 @@ jobs:
name: "Local-min-console: ${{ matrix.mapdl-version }}"
runs-on: ubuntu-22.04
if: github.ref != 'refs/heads/main' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
needs: [smoke-tests, build-test-local-minimal-matrix]
needs: [build-test-ubuntu-local, build-test-remote]
timeout-minutes: 75
strategy:
fail-fast: false
matrix: ${{fromJson(needs.build-test-local-minimal-matrix.outputs.matrix)}}
matrix:
mapdl-version: ['latest-ubuntu', 'v25.1-ubuntu']
container:
image: ghcr.io/ansys/mapdl:${{ matrix.mapdl-version }}
options: -u=0:0 --oom-kill-disable --memory=6656MB --memory-swap=16896MB --shm-size=1gb --entrypoint /bin/bash
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,6 @@ repos:

# this validates our github workflow files
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.30.0
rev: 0.31.0
hooks:
- id: check-github-workflows
1 change: 1 addition & 0 deletions doc/changelog.d/3657.maintenance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ci: pre-commit autoupdate
1 change: 1 addition & 0 deletions doc/changelog.d/3662.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fix: parsing components when too many
1 change: 1 addition & 0 deletions doc/changelog.d/3667.maintenance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ci: downgrade add-license-headers ansys precommit hook.
1 change: 1 addition & 0 deletions doc/changelog.d/3668.maintenance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ci: skipping students version if on remote
1 change: 1 addition & 0 deletions doc/changelog.d/3669.maintenance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ci: reducing minimal and console to two versions, and after local and remote
1 change: 1 addition & 0 deletions doc/changelog.d/3673.dependencies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build: bump pyfakefs from 5.7.3 to 5.7.4
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ tests = [
"matplotlib==3.10.0",
"pandas==2.2.3",
"pyansys-tools-report==0.8.1",
"pyfakefs==5.7.3",
"pyfakefs==5.7.4",
"pyiges[full]==0.3.1",
"pytest-cov==6.0.0",
"pytest-pyvista==0.1.9",
Expand Down
4 changes: 2 additions & 2 deletions src/ansys/mapdl/core/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -580,13 +580,13 @@ def _parse_cmlist(cmlist: Optional[str] = None) -> Dict[str, Any]:
# header
# "NAME TYPE SUBCOMPONENTS"
blocks = re.findall(
r"(?s)NAME\s+TYPE\s+SUBCOMPONENTS\s+(.*?)\s*(?=\n\s*\n|\Z)",
r"(?s)NAME\s+TYPE\s+SUBCOMPONENTS\s+(.*?)\s*(?=\n\s*\n|\*\*\*\*\*|\Z)",
cmlist,
flags=re.DOTALL,
)
elif re.search(r"NAME\s+SELE\s+TYPE\s+SUBCOMPONENTS", cmlist):
blocks = re.findall(
r"(?s)NAME\s+SELE\s+TYPE\s+SUBCOMPONENTS\s+(.*?)\s*(?=\n\s*\n|\Z)",
r"(?s)NAME\s+SELE\s+TYPE\s+SUBCOMPONENTS\s+(.*?)\s*(?=\n\s*\n|\*\*\*\*\*|\Z)",
cmlist,
flags=re.DOTALL,
)
Expand Down
18 changes: 18 additions & 0 deletions tests/test_component.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,24 @@ def test_logger(mapdl, cleared):
assert mapdl.components.logger == mapdl.logger


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

for i in range(1, 100):
mapdl.nsel("NONE")
mapdl.n(i, i, 0, 0)
mapdl.cm(f"node_{i:03.0f}", "NODE")

s = mapdl.components.__str__()
assert len(mapdl.components._comp) == 99

assert "VERIFICATION" not in s
assert "***" not in s
assert "*****MAPDL" not in s
for i in range(1, 100):
assert re.search(f"NODE_{i:03.0f}\s+: NODE", s)


class Test_components(TestClass):

@staticmethod
Expand Down

0 comments on commit 8033fb4

Please sign in to comment.