Skip to content

Commit 6f32b18

Browse files
authored
fix intellisense on VSCode (#685)
* fix intellisense on VSCode * remove unused imports * add landing page demo * mp4 to gif * Update README.rst * improve landing demo * cleanup readme
1 parent ce1bb5e commit 6f32b18

File tree

5 files changed

+41
-18
lines changed

5 files changed

+41
-18
lines changed

README.rst

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,39 @@ PyMAPDL
33
.. image:: https://img.shields.io/pypi/v/ansys-mapdl-core.svg
44
:target: https://pypi.org/project/ansys-mapdl-core/
55

6-
.. image:: https://dev.azure.com/pyansys/pyansys/_apis/build/status/pyansys.pymapdl?branchName=master
7-
:target: https://dev.azure.com/pyansys/pyansys/_build/latest?definitionId=5&branchName=master
6+
.. image:: https://github.com/pyansys/pymapdl/actions/workflows/ci.yml/badge.svg
7+
:target: https://github.com/pyansys/pymapdl/actions/workflows/tci.yml
88

99
.. image:: https://zenodo.org/badge/70696039.svg
1010
:target: https://zenodo.org/badge/latestdoi/70696039
1111

12+
.. image:: https://img.shields.io/badge/License-MIT-yellow.svg
13+
:target: https://opensource.org/licenses/MIT
14+
15+
.. image:: https://img.shields.io/pypi/dm/ansys-mapdl-core.svg?label=PyPI%20downloads
16+
:target: https://pypi.org/project/ansys-mapdl-core/
17+
18+
Overview
19+
--------
20+
The PyMAPDL project supports Pythonic access to MAPDL to be able to
21+
communicate with the MAPDL process directly from Python. The latest
22+
ansys-mapdl-core package enables a more comprehensive interface with
23+
MAPDL and supports:
24+
25+
- All the features of the original module (e.g. pythonic commands,
26+
interactive sessions).
27+
- Remote connections to MAPDL from anywhere via gRPC.
28+
- Direct access to MAPDL arrays, meshes, and geometry as Python
29+
objects.
30+
- Low level access to the MAPDL solver through APDL math in a scipy
31+
like interface.
32+
33+
Here's a quick demo of PyMAPDL within VSCode:
34+
35+
.. image:: https://github.com/pyansys/pymapdl/raw/fix/auto_complete_vscode/doc/landing_page_demo.gif
36+
37+
PyMAPDL works within Jupyter Notebooks, the standard Python console,
38+
or in batch mode on Windows, Linux, and even Mac OS.
1239

1340
Documentation and Issues
1441
------------------------
@@ -22,6 +49,7 @@ Please feel free to post issues and other questions at `PyMAPDL Issues
2249
to post questions and code.
2350

2451

52+
2553
Project Transition - Legacy Support
2654
-----------------------------------
2755
This project was formerly known as ``pyansys``, and we'd like to thank

ansys/mapdl/core/__init__.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,6 @@
2828

2929
from ansys.mapdl.core import examples
3030

31-
# from ansys.mapdl.core.xpl import ansXpl
32-
# from ansys.mapdl.core.math import MapdlMath
33-
34-
# from ansys.mapdl.core.mapdl_azure import MapdlAzure, JupyterAzureClient
35-
3631
_HAS_ANSYS = _check_has_ansys()
3732

3833
# Setup data directory
@@ -47,7 +42,3 @@
4742

4843
except: # pragma: no cover
4944
pass
50-
51-
52-
if "ANSJUPHUB_VER" in os.environ:
53-
from ansys.mapdl.core.jupyter import launch_mapdl_on_cluster as launch_mapdl

ansys/mapdl/core/launcher.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
VersionError,
1919
)
2020
from ansys.mapdl.core.mapdl_grpc import MapdlGrpc
21-
from ansys.mapdl.core.licensing import LicenseChecker
22-
from ansys.mapdl.core.licensing import ALLOWABLE_LICENSES
21+
from ansys.mapdl.core.licensing import LicenseChecker, ALLOWABLE_LICENSES
22+
from ansys.mapdl.core.mapdl import _MapdlCore
2323
from ansys.mapdl.core import LOG
2424

2525
# settings directory
@@ -755,7 +755,7 @@ def launch_mapdl(
755755
license_server_check=True,
756756
license_type=None,
757757
**kwargs,
758-
):
758+
) -> _MapdlCore:
759759
"""Start MAPDL locally in gRPC mode.
760760
761761
Parameters
@@ -878,6 +878,11 @@ def launch_mapdl(
878878
will be requested, being up to the license server to provide a specific
879879
license type. Default is ``None``.
880880
881+
Returns
882+
-------
883+
ansys.mapdl.core.mapdl._MapdlCore
884+
An instance of Mapdl. Type depends on the selected ``mode``.
885+
881886
Notes
882887
-----
883888
These are the MAPDL switch options as of 2020R2 applicable for
@@ -994,7 +999,7 @@ def launch_mapdl(
994999
set_no_abort = kwargs.get("set_no_abort", True)
9951000
ip = os.environ.get("PYMAPDL_IP", ip)
9961001
if "PYMAPDL_PORT" in os.environ:
997-
port = int(os.environ.get("PYMAPDL_PORT"))
1002+
port = int(os.environ.get("PYMAPDL_PORT", '50052'))
9981003
if port is None:
9991004
port = MAPDL_DEFAULT_PORT
10001005

ansys/mapdl/core/mapdl.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,8 @@ class _MapdlCore(Commands):
124124
"""Contains methods in common between all Mapdl subclasses"""
125125

126126
def __init__(self, loglevel='DEBUG', use_vtk=True, log_apdl=False,
127-
log_file=True,
128-
local=True, **start_parm):
129-
"""Initialize connection with MAPDL. """
127+
log_file=True, local=True, **start_parm):
128+
"""Initialize connection with MAPDL."""
130129
self._show_matplotlib_figures = True # for testing
131130
self._query = None
132131
self._exited = False

doc/landing_page_demo.gif

3.81 MB
Loading

0 commit comments

Comments
 (0)