Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix intellisense on VSCode #685

Merged
merged 8 commits into from
Oct 31, 2021
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
32 changes: 30 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,39 @@ PyMAPDL
.. image:: https://img.shields.io/pypi/v/ansys-mapdl-core.svg
:target: https://pypi.org/project/ansys-mapdl-core/

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

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

.. image:: https://img.shields.io/badge/License-MIT-yellow.svg
:target: https://opensource.org/licenses/MIT

.. image:: https://img.shields.io/pypi/dm/ansys-mapdl-core.svg?label=PyPI%20downloads
:target: https://pypi.org/project/ansys-mapdl-core/

Overview
--------
The PyMAPDL project supports Pythonic access to MAPDL to be able to
communicate with the MAPDL process directly from Python. The latest
ansys-mapdl-core package enables a more comprehensive interface with
MAPDL and supports:

- All the features of the original module (e.g. pythonic commands,
interactive sessions).
- Remote connections to MAPDL from anywhere via gRPC.
- Direct access to MAPDL arrays, meshes, and geometry as Python
objects.
- Low level access to the MAPDL solver through APDL math in a scipy
like interface.

Here's a quick demo of PyMAPDL within VSCode:

.. image:: https://github.com/pyansys/pymapdl/raw/fix/auto_complete_vscode/doc/landing_page_demo.gif

PyMAPDL works within Jupyter Notebooks, the standard Python console,
or in batch mode on Windows, Linux, and even Mac OS.

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



Project Transition - Legacy Support
-----------------------------------
This project was formerly known as ``pyansys``, and we'd like to thank
Expand Down
9 changes: 0 additions & 9 deletions ansys/mapdl/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@

from ansys.mapdl.core import examples

# from ansys.mapdl.core.xpl import ansXpl
# from ansys.mapdl.core.math import MapdlMath

# from ansys.mapdl.core.mapdl_azure import MapdlAzure, JupyterAzureClient

_HAS_ANSYS = _check_has_ansys()

# Setup data directory
Expand All @@ -47,7 +42,3 @@

except: # pragma: no cover
pass


if "ANSJUPHUB_VER" in os.environ:
from ansys.mapdl.core.jupyter import launch_mapdl_on_cluster as launch_mapdl
13 changes: 9 additions & 4 deletions ansys/mapdl/core/launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
VersionError,
)
from ansys.mapdl.core.mapdl_grpc import MapdlGrpc
from ansys.mapdl.core.licensing import LicenseChecker
from ansys.mapdl.core.licensing import ALLOWABLE_LICENSES
from ansys.mapdl.core.licensing import LicenseChecker, ALLOWABLE_LICENSES
from ansys.mapdl.core.mapdl import _MapdlCore
from ansys.mapdl.core import LOG

# settings directory
Expand Down Expand Up @@ -755,7 +755,7 @@ def launch_mapdl(
license_server_check=True,
license_type=None,
**kwargs,
):
) -> _MapdlCore:
"""Start MAPDL locally in gRPC mode.

Parameters
Expand Down Expand Up @@ -878,6 +878,11 @@ def launch_mapdl(
will be requested, being up to the license server to provide a specific
license type. Default is ``None``.

Returns
-------
ansys.mapdl.core.mapdl._MapdlCore
An instance of Mapdl. Type depends on the selected ``mode``.

Notes
-----
These are the MAPDL switch options as of 2020R2 applicable for
Expand Down Expand Up @@ -994,7 +999,7 @@ def launch_mapdl(
set_no_abort = kwargs.get("set_no_abort", True)
ip = os.environ.get("PYMAPDL_IP", ip)
if "PYMAPDL_PORT" in os.environ:
port = int(os.environ.get("PYMAPDL_PORT"))
port = int(os.environ.get("PYMAPDL_PORT", '50052'))
if port is None:
port = MAPDL_DEFAULT_PORT

Expand Down
5 changes: 2 additions & 3 deletions ansys/mapdl/core/mapdl.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,8 @@ class _MapdlCore(Commands):
"""Contains methods in common between all Mapdl subclasses"""

def __init__(self, loglevel='DEBUG', use_vtk=True, log_apdl=False,
log_file=True,
local=True, **start_parm):
"""Initialize connection with MAPDL. """
log_file=True, local=True, **start_parm):
"""Initialize connection with MAPDL."""
self._show_matplotlib_figures = True # for testing
self._query = None
self._exited = False
Expand Down
Binary file added doc/landing_page_demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.