Skip to content

Commit

Permalink
Merge branch 'main' into maint/v0.68.2-changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
clatapie authored Jun 24, 2024
2 parents 2e209d6 + 2b9ba18 commit eb7492c
Show file tree
Hide file tree
Showing 10 changed files with 102 additions and 22 deletions.
10 changes: 9 additions & 1 deletion .github/labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@
# and assign a label to the new pull requrest.
#
# Check the yml for more info: .github\workflows\label.yml
#

#############################################################
# NOTES
# =====
#
# If the labels names are change, the file ``./.github/release.yml`` should be also updated!
#

#############################################################
# Main colors (hex)
Expand Down Expand Up @@ -62,7 +70,7 @@
description: "Issue, problem or error in PyMAPDL"
color: E67E22

- name: new Feature
- name: new feature
description: "Request or proposal for a new feature"
color: 85C1E9

Expand Down
15 changes: 8 additions & 7 deletions .github/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,21 @@ changelog:
categories:
- title: New Features
labels:
- Enhancement
- NEW FEATURE
- enhancement
- new feature
- title: Bug fixes or behavior changes
labels:
- BUG
- bug
- BLOCKER
- title: Documentation
labels:
- Documentation
- Examples
- documentation
- examples
- title: Maintenance
labels:
- Maintenance
- Dependencies
- maintenance
- dependencies
- CI/CD
- title: MAPDL and/or API related
labels:
- MAPDL
22 changes: 11 additions & 11 deletions .github/workflows/label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
startsWith(github.event.pull_request.head.ref, 'docs')
with:
github_token: ${{ secrets.GITHUB_TOKEN}}
labels: Documentation
labels: documentation

- uses: actions-ecosystem/action-add-labels@v1
if: |
Expand All @@ -64,23 +64,23 @@ jobs:
if: startsWith(github.event.pull_request.head.ref, 'maint')
with:
github_token: ${{ secrets.GITHUB_TOKEN}}
labels: Maintenance
labels: maintenance

- uses: actions-ecosystem/action-add-labels@v1
if: startsWith(github.event.pull_request.head.ref, 'feat')
with:
github_token: ${{ secrets.GITHUB_TOKEN}}
labels: |
Enhancement
NEW FEATURE
enhancement
new feature
- uses: actions-ecosystem/action-add-labels@v1
if: |
startsWith(github.event.pull_request.head.ref, 'fix') ||
startsWith(github.event.pull_request.head.ref, 'patch')
with:
github_token: ${{ secrets.GITHUB_TOKEN}}
labels: BUG
labels: bug

commenter:
runs-on: ubuntu-latest
Expand All @@ -97,12 +97,12 @@ jobs:
issue-number: ${{ github.event.pull_request.number }}
body: |
Please add one of the following labels to add this contribution to the Release Notes :point_down:
- [BUG](https://github.com/ansys/pymapdl/pulls?q=label%3Abug+)
- [NEW FEATURE](https://github.com/ansys/pymapdl/pulls?q=label%3A"NEW%20FEATURE"+)
- [Enhancement](https://github.com/ansys/pymapdl/pulls?q=label%3Aenhancement+)
- [Documentation](https://github.com/ansys/pymapdl/pulls?q=label%3Adocumentation+)
- [Examples](https://github.com/ansys/pymapdl/pulls?q=label%3Aexamples+)
- [Maintenance](https://github.com/ansys/pymapdl/pulls?q=label%3Amaintenance+)
- [bug](https://github.com/ansys/pymapdl/pulls?q=label%3Abug+)
- [new feature](https://github.com/ansys/pymapdl/pulls?q=label%3A"new%20feature"+)
- [enhancement](https://github.com/ansys/pymapdl/pulls?q=label%3Aenhancement+)
- [documentation](https://github.com/ansys/pymapdl/pulls?q=label%3Adocumentation+)
- [examples](https://github.com/ansys/pymapdl/pulls?q=label%3Aexamples+)
- [maintenance](https://github.com/ansys/pymapdl/pulls?q=label%3Amaintenance+)
- [CI/CD](https://github.com/ansys/pymapdl/pulls?q=label%3Aci%2Fcd+)
changelog-fragment:
Expand Down
1 change: 1 addition & 0 deletions doc/changelog.d/3188.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fix: using same labels everywhere
1 change: 1 addition & 0 deletions doc/changelog.d/3194.dependencies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build: bump pyvista[trame] from 0.43.9 to 0.43.10
1 change: 1 addition & 0 deletions doc/changelog.d/3197.dependencies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build: bump the minimal group across 1 directory with 2 updates
1 change: 1 addition & 0 deletions doc/changelog.d/3198.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
feat: Add an inprocess backend to pymapdl
4 changes: 2 additions & 2 deletions minimum_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ansys-api-mapdl==0.5.1
importlib-metadata==7.1.0
importlib-metadata==7.2.0
numpy==1.26.4
platformdirs==4.2.2
psutil==5.9.8
psutil==6.0.0
pyansys-tools-versioning==0.5.0
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ doc = [
"pypandoc==1.13",
"pytest-sphinx==0.6.3",
"pythreejs==2.4.2",
"pyvista[trame]==0.43.9",
"pyvista[trame]==0.43.10",
"sphinx-autobuild==2024.4.16",
"sphinx-autodoc-typehints==1.25.2",
"sphinx-copybutton==0.5.2",
Expand Down Expand Up @@ -150,6 +150,8 @@ omit = [
# ignore legacy interfaces
"ansys/mapdl/core/mapdl_console.py",
"ansys/mapdl/core/jupyter.py",
# ignore non exposed interfaces
"ansys/mapdl/core/mapdl_inprocess.py",
]

[tool.coverage.report]
Expand Down
65 changes: 65 additions & 0 deletions src/ansys/mapdl/core/mapdl_inprocess.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Copyright (C) 2024 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

from typing import Optional, Protocol

from ansys.mapdl.core.mapdl import MapdlBase


class _Backend(Protocol):
def run_command(self) -> str: ...


class MapdlInProcess(MapdlBase):
def __init__(self, backend: _Backend):
super().__init__(
loglevel="WARNING", use_vtk=False, log_apdl=None, print_com=False
)
self._backend = backend
self._cleanup: bool = True
self._name: str = "MapdlInProcess"
self._session_id: Optional[str] = None
self._mute: bool = False

def _run(self, command: str, verbose: bool = False, mute: bool = False) -> str:
if not command.strip():
raise ValueError("Empty commands not allowed")

if len(command) > 639:
raise ValueError("Maximum command length mut be less than 640 characters")

return self._backend.run_command(command, verbose, mute).strip()

@property
def name(self) -> str:
return self._name

@name.setter
def name(self, name) -> None:
self._name = name

def _check_session_id(self) -> None:
pass

def __repr__(self):
info = super().__repr__()
return info

0 comments on commit eb7492c

Please sign in to comment.