package
stringlengths 1
122
| pacakge-description
stringlengths 0
1.3M
|
---|---|
ansutr-transliteration
|
AI4Bharat Indic-TransliterationAn AI-based transliteration engine for 21 major languages of the Indian subcontinent.This package provides support for:Python Library for transliteration from Roman to Native scriptHTTP API server that can be hosted for interaction with web applicationsAboutThis library is based on ourresearch workcalledIndic-Xlitto build tools that can translit text between Indic languages and colloquially-typed content (in English alphabet). We support both Roman-to-Native back-transliteration (English script to Indic language conversion), as well as Native-to-Roman transliteration (Indic to English alphabet conversion).An online demo is available here:https://xlit.ai4bharat.orgLanguages SupportedISO 639 codeLanguageasAssamese - অসমীয়াbnBangla - বাংলাbrxBoro - बड़ोguGujarati - ગુજરાતીhiHindi - हिंदीknKannada - ಕನ್ನಡksKashmiri - كٲشُرgomKonkani Goan - कोंकणीmaiMaithili - मैथिलीmlMalayalam - മലയാളംmniManipuri - ꯃꯤꯇꯩꯂꯣꯟmrMarathi - मराठीneNepali - नेपालीorOriya - ଓଡ଼ିଆpaPanjabi - ਪੰਜਾਬੀsaSanskrit - संस्कृतम्sdSindhi - سنڌيsiSinhala - සිංහලtaTamil - தமிழ்teTelugu - తెలుగుurUrdu - اُردُوUsagePython LibraryImport the wrapper for transliteration engine by:fromai4bharat.transliterationimportXlitEngineExample 1: Using word Transliteratione=XlitEngine("hi",beam_width=10,rescore=True)out=e.translit_word("namasthe",topk=5)print(out)# output: {'hi': ['नमस्ते', 'नमस्थे', 'नामस्थे', 'नमास्थे', 'नमस्थें']}Arguments:beam_widthincreases search size, resulting in improved accuracy but increases time/compute. (Default:4)topkreturns only specified number of top results. (Default:4)rescorereturns the reranked suggestions after using a dictionary. (Default:True)Romanization:By default,XlitEnginewill load English-to-Indic model (default:src_script_type="roman")To load Indic-to-English model, usesrc_script_type="indic"For example: (also applicable for all other examples below)e=XlitEngine(src_script_type="indic",beam_width=10,rescore=False)out=e.translit_word("नमस्ते",lang_code="hi",topk=5)print(out)# output: ['namaste', 'namastey', 'namasthe', 'namastay', 'namste']Example 2: word Transliteration without rescoringe=XlitEngine("hi",beam_width=10,rescore=False)out=e.translit_word("namasthe",topk=5)print(out)# output: {'hi': ['नमस्थे', 'नामस्थे', 'नमास्थे', 'नमस्थें', 'नमस्ते']}Example 3: Using Sentence Transliteratione=XlitEngine("ta",beam_width=10)out=e.translit_sentence("vanakkam ulagam")print(out)# output: {'ta': 'வணக்கம் உலகம்'}Note:Only single top most prediction is returned for each word in sentence.Example 4: Using Multiple language Transliteratione=XlitEngine(["ta","ml"],beam_width=6)# leave empty or use "all" to load all available languages# e = XlitEngine("all)out=e.translit_word("amma",topk=3)print(out)# output: {'ml': ['അമ്മ', 'എമ്മ', 'അമ'], 'ta': ['அம்மா', 'அம்ம', 'அம்மை']}out=e.translit_sentence("vandhe maatharam")print(out)# output: {'ml': 'വന്ധേ മാതരം', 'ta': 'வந்தே மாதரம்'}## Specify language name to get only specific language resultout=e.translit_word("amma",lang_code="ml",topk=5)print(out)# output: ['അമ്മ', 'എമ്മ', 'അമ', 'എഎമ്മ', 'അഎമ്മ']Example 5: Transliteration for all available languagese=XlitEngine(beam_width=10)out=e.translit_sentence("namaskaar bharat")print(out)# sample output: {'bn': 'নমস্কার ভারত', 'gu': 'નમસ્કાર ભારત', 'hi': 'नमस्कार भारत', 'kn': 'ನಮಸ್ಕಾರ್ ಭಾರತ್', 'ml': 'നമസ്കാർ ഭാരത്', 'pa': 'ਨਮਸਕਾਰ ਭਾਰਤ', 'si': 'නමස්කාර් භාරත්', 'ta': 'நமஸ்கார் பாரத்', 'te': 'నమస్కార్ భారత్', 'ur': 'نمسکار بھارت'}Web API ServerRunning a flask server using a 3-line script:fromai4bharat.transliterationimportxlit_serverapp,engine=xlit_server.get_app()app.run(host='0.0.0.0',port=8000)Then on browser (or) curl, use link ashttp://{IP-address}:{port}/tl/{lang-id}/{word_in_eng_script}Example:http://localhost:8000/tl/ta/ammahttp://localhost:8000/languagesDebugging errorsIf you face any of the following errors:ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 80 from PyObject
ValueError: Please build (or rebuild) Cython components withpython setup.py build_ext --inplace.Run:pip install --upgrade numpyRelease NotesThis package contains applications built around the Transliteration engine. The contents of this package can also be downloaded fromour GitHub repo.All the NN models of Indic-Xlit are released under MIT License.
|
answer
|
OverviewThis project is aimed to serve as a wrapper for the Digipathos dataset, in order to list and download public data from plant pathologies provided by Embrapa (Brazilian Agricultural Research Corporation).Example of pictures:InstallationThe installation is pretty simple if you have a virtualenv already installed on your machine. If you don't please rely toVirtualEnv official documentation.pipinstalldigipathosDocumentationBesides the docstrings, major details about the documentation can be foundhere.TestingThis project is inteded to suit most of the existent needs, so for this reason, testability is a major concern. Most of the code is heavily tested, along withTravisas Continuous Integration tool to run all the unit tests once there is a new commit.UsageYou can use Digipathos in two different ways: via terminal or programatically.CLI (Command-Line Interface)This mode is highly recommended for those who are looking to explore a little bit the dataset. Here you can do the same operations from the programmatic mode, but with the advantage of being able to see all the data that is being retrieved.digipathosAnd then you're gonna be greeted by our dataset browser :-)An example listing all the datasets:Programmaticallydata_loader=DataLoader()# list all the datasetsdatasets=data_loader.get_datasets()# now lets give a look at the cropscrops=data_loader.get_crops()# how about getting all the datasets from a crop?datasets_from_crop=data_loader.get_datasets_from_crop('Pineapple')# now let's download a random datasetdataset_id=random.choice(list(datasets.keys()))data_loader.download_dataset(dataset_id=dataset_id)# download all from a given cropdata_loader.download_datasets_from_crop('Pineapple')# download all the datasetsdata_loader.download_all_datasets()Pretty simple, huh?A working example can be foundhere as a Python script.TroubleshootingIn case of any issue with the project, or for further questions, do not hesitate to open an issue here on GitHub.ContributionsContributions are really welcome, so feel free to open a pull request :-)
|
answerbook-identify-logline
|
No description available on PyPI.
|
answerbook-webhook-test
|
No description available on PyPI.
|
answerdiff
|
Checking Submissions the Boss Way using Celery and DRFDocumentationThe full documentation is athttps://django-answerdiff.readthedocs.org.QuickstartInstall answerdiff:pip install django-answerdiffThen use it in a project:import answerdiffFeaturesTODORunning TestsDoes the code actually work?source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install -r requirements-text.txt
(myenv) $ python runtests.pyCreditsTools used in rendering this package:Cookiecuttercookiecutter-pypackageHistory0.1.0 (2015-10-02)First release on PyPI.
|
answerer
|
See here for more information:https://github.com/abrow425/gotIssues
|
answer-finder
|
No description available on PyPI.
|
answeroid
|
UNKNOWN
|
answerrocket-client
|
AnswerRocket Skill API ClientThis is a client library for interacting with an AnswerRocket instance. Its purpose is to enable the development of skills (custom AnswerRocket extensions) without the need for AnswerRocket to be running locally.Installationpip install answerrocket-clientUsefrom answer_rocket import AnswerRocketClient
arc = AnswerRocketClient(url='https://your-answerrocket-instance.com', token='<your_api_token>')
# test that the config is valid
arc.can_connect()
# Get a resource file. When running in an AnswerRocket instance, this call will fetch a customized version of the resource if one has been created.
import json
some_resource = json.loads(arc.config.get_artifact('path/to/my/file.json'))
# to run SQL, get the database ID from an AnswerRocket environment
table_name = "my_table"
sql = "SELECT sum(my_measure) from "+table_name
database_id = "my_database_id"
execute_sql_query_result = arc.data.execute_sql_query(database_id, sql, 100)
if execute_sql_query_result.success:
print(execute_sql_query_result.df)
else:
print(execute_sql_query_result.error)
print(execute_sql_query_result.code)
# language model calls use the configured settings from the connected Max instance (except for the secret key)
success, model_reply = arc.chat.completion(messages = "hakuna")
if success:
# the reply is the full value of the LLM's return object
reply = model_reply["choices"][0]["message"]["content"]
print(f"** {reply} **")
else:
# error reply is a description of the exception
print("Error: "+model_reply)
# chat conversations and streaming replies are supported
messages = [
{ "role":"system",
"content":"You are an efficient assistant helping a business user answer questions about data."},
{ "role":"user",
"content":"Can you tell me the average of 150,12,200,54,24 and 32? are any of these outliers? Explain why."}
]
def display_streaming_result(str):
print(str,end="", flush=True)
success, reply = arc.chat.completion(messages = messages, stream_callback=display_streaming_result)Notes:both the token and instance URL can be provided via the AR_TOKEN and AR_URL env vars instead, respectively. This is recommended to avoid accidentally committing a dev api token in your skill code. API token is available through the AnswerRocket UI for authenticated users.when running outside of an AnswerRocket installation such as during development, make sure the openai key is set before importing answer_rocket, like os.environ['OPENAI_API_KEY'] = openai_completion_key. Get this key from OpenAI.Working on the SDKSetupThis repository contains a .envrc file for use with direnv. With that installed you should have a separate python interpreter that direnv's hook will activate for you when you cd into this repository.Once you have direnv set up and activating inside the repo, justmaketo install dev dependencies and get started.Finding things in the codebaseThe main point of contact with users of this sdk isAnswerRocketClientinanswer_rocket/client.py. That is, it is what users will import and initialize. Different categories of utilities can be grouped into modules in whatever way is most convenient, but they should be exposed via the client rather than through a separate import so that utilities for authentication, etc., can be reused.The client hits an sdk-specific GraphQL API on its target AnswerRocket server. There is agraphql/schema.pywith generated python types for what queries are available. When needed it can be regenerated with thegenerate-gql-schemamakefile target. See the Makefile for details.
|
answers
|
This library/project seeks to simplfy the installation of unix applications which typically require a list of questions to be answered or commands to be run. The idea is to provide a simple library which can run a script file against an executable, automating the entire process.When combined with a configuration management tool, such as Puppet or Chef, this library should be very powerful.
|
ansypyttsx3
|
This modules helps to convert any text to speech with only one command
speak()
which is very useful for beginersdeveloped by:-
Anto Joel [email protected] @ Francis Xavier Engineering College, TVLChange Log0.0.1 (27/07/2021)-First Release
|
ansys-ace-project-gen
|
Ansys ACE Project GeneratorPrerequisitesUsageContributing
|
ansys-additive-core
|
OverviewPyAdditive is a Python client library for theAnsys Additiveservice.InstallationYou can usepipto install PyAdditive.pipinstallansys-additive-coreTo install the latest development version, run these commands:gitclonehttps://github.com/ansys/pyadditivecdpyadditivepipinstall-e.For more information, seeGetting Started.Basic usageThis code shows how to import PyAdditive and use some basic capabilities:importansys.additive.coreaspyadditiveadditive=pyadditive.Additive()input=pyadditive.SingleBeadInput(machine=pyadditive.AdditiveMachine(),material=additive.material("Ti64"),id="bead1",bead_length=0.001,# meters)summary=additive.simulate(input)For comprehensive usage information, seeExamplesin thePyAdditive Documentation.Documentation and issuesDocumentation for the latest stable release of PyAdditive is hosted atPyAdditive documentation.In the upper right corner of the documentation’s title bar, there is an option for switching from
viewing the documentation for the latest stable release to viewing the documentation for the
development version or previously released versions.On thePyAdditive Issuespage,
you can create issues to report bugs and request new features. On thePyAdditive Discussionspage or theDiscussionspage on the Ansys Developer portal, you can post questions, share ideas, and get community feedback.To reach the project support team, [email protected].
|
ansys-api-acp
|
ansys-api-acp gRPC Interface PackageThis Python package contains the auto-generated gRPC Python interface files for
ACP.InstallationProvided that these wheels have been published to public PyPI, they can be
installed with:pip install ansys-api-acpOtherwise, see theBuildTo build the gRPC packages, run:pip install build
python -m buildThis will create both the source distribution containing just the protofiles
along with the wheel containing the protofiles and build Python interface
files.Note that the interface files are identical regardless of the version of Python
used to generate them, but the last pre-built wheel forgrpcio~=1.17was
Python 3.7, so to improve your build time, use Python 3.7 when building the
wheel.Manual DeploymentAfter building the packages, manually deploy them with:pip install twine
twine upload dist/*Note that this is automatically done through CI/CD.Automatic DeploymentThis repository contains GitHub CI/CD that enables the automatic building of
source and wheel packages for these gRPC Python interface files. By default,
these are built on PRs, the main branch, and on tags when pushing. Artifacts
are uploaded for each PR.To publicly release wheels to PyPI, ensure your branch is up-to-date and then
push tags. For example, for the versionv0.5.0.gittagv0.5.0
gitpush--tags
|
ansys-api-additive
|
ansys-api-additive gRPC Interface PackageThis package contains the gRPC interface files for the Additive
service. It is published both as a python and nuget package.Python InstallationProvided that these wheels have been published to public PyPI, they can be installed with:pip install ansys-api-additivePython BuildTo build the gRPC packages, run:pip install build
python -m buildThis will create both the source distribution containing just the protofiles along with the wheel containing the protofiles and build Python interface files.Python Manual DeploymentAfter building the packages, manually deploy them with:pip install twine
twine upload dist/*Note that this is automatically done through CI/CD.Nuget InstallationThe nuget package is calledAnsys.Api.Additiveand is published
to a repository on GitHub. To access the repository, you will
need to create a nuget source with your GitHub user credentials.dotnet nuget add source --username USERNAME --password GITHUB_TOKEN --store-password-in-clear-text --name ansys "https://nuget.pkg.github.com/ansys/index.json"For more information, seeGitHub Working with the NuGet registry.Nuget BuildTo build the nuget package, run:dotnet pack csharp/Ansys.Api.Additive.csproj -o packageNuget Manual DeploymentOnce the nuget package is built, manually deploy it with the following command. Note that this uses the same nuget source created in the Installation step.dotnet nuget push ./**/*.nupkg --source ansysNote that this is automatically done through CI/CD.Automatic DeploymentThis repository contains GitHub CI/CD that enables the automatic building of source, wheel, and nuget packages for these gRPC interface files. By default, these are built on PRs, the main branch, and on tags when pushing. Artifacts are uploaded for each PR.To publicly release the packages, ensure your branch is up-to-date and then push tags. For example, for the versionv0.5.0.gittagv0.5.0
gitpush--tags
|
ansys-api-dbu
|
ansys-api-dbu gRPC Interface PackageThis repository provides the auto-generated gRPC Python interface files for
the Ansys DBU Service.InstallationProvided that these wheels have been published to public PyPI, they can be
installed with:pip install ansys-api-dbuBuildTo build the gRPC packages, run:pip install build
python -m buildThis will create both the source distribution containing just the protofiles
along with the wheel containing the protofiles and build Python interface
files.Manual DeploymentAfter building the packages, manually deploy them with:pip install twine
twine upload dist/*Note that this is automatically done through CI/CD.Automatic DeploymentThis repository contains GitHub CI/CD that enables the automatic building of
source and wheel packages for these gRPC Python interface files. By default,
these are built on PRs, the main branch, and on tags when pushing. Artifacts
are uploaded for each PR.To publicly release wheels to PyPI, ensure your branch is up-to-date and then
push tags. For example, for the versionv0.5.0.gittagv0.5.0
gitpush--tags
|
ansys-api-discovery
|
ansys-api-discovery gRPC Interface PackageThis repository provides the auto-generated gRPC Python interface files
for Discovery/SpaceClaim.InstallationProvided that these wheels have been published to public PyPI, they can be
installed with:pip install ansys-api-discoveryBuildTo build the gRPC packages, run:pip install build
python -m buildThis will create both the source distribution containing just the protofiles
along with the wheel containing the protofiles and build Python interface
files.Note that the interface files are identical regardless of the version of Python
used to generate them, but the last pre-built wheel forgrpcio~=1.47was
Python 3.7, so to improve your build time, use Python 3.7 when building the
wheel.Manual DeploymentAfter building the packages, manually deploy them with:pip install twine
twine upload dist/*Note that this is automatically done through CI/CD.Automatic DeploymentThis repository contains GitHub CI/CD that enables the automatic building of
source and wheel packages for these gRPC Python interface files. By default,
these are built on PRs, the main branch, and on tags when pushing. Artifacts
are uploaded for each PR.To publicly release wheels to PyPI, ensure your branch is up-to-date and then
push tags. For example, for the versionv0.5.1.gittagv0.5.1
gitpush--tags
|
ansys-api-dyna
|
ansys-api-dyna gRPC Interface PackageThis Python package contains the auto-generated gRPC Python interface files for
dyna.InstallationProvided that these wheels have been published to public PyPI, they can be
installed with:pip install ansys-api-dynaOtherwise, see theBuildTo build the gRPC packages, run:pip install build
python -m buildThis will create both the source distribution containing just the protofiles
along with the wheel containing the protofiles and build Python interface
files.Note that the interface files are identical regardless of the version of Python
used to generate them, but the last pre-built wheel forgrpcio~=1.17was
Python 3.7, so to improve your build time, use Python 3.7 when building the
wheel.Manual DeploymentAfter building the packages, manually deploy them with:pip install twine
twine upload dist/*Note that this is automatically done through CI/CD.Automatic DeploymentThis repository contains GitHub CI/CD that enables the automatic building of
source and wheel packages for these gRPC Python interface files. By default,
these are built on PRs, the main branch, and on tags when pushing. Artifacts
are uploaded for each PR.To publicly release wheels to PyPI, ensure your branch is up-to-date and then
push tags. For example, for the versionv0.5.0.gittagv0.5.0
gitpush--tags
|
ansys-api-edb
|
ansys-api-edb gRPC Interface PackageThis repository provides the auto-generated gRPC Python interface files for
the Ansys Edb Service.InstallationProvided that these wheels have been published to public PyPI, they can be
installed with:pip install ansys-api-edbBuildTo build the gRPC packages, run:pip install build
python -m buildThis will create both the source distribution containing just the protofiles
along with the wheel containing the protofiles and build Python interface
files.
|
ansys-api-fluent
|
ansys-api-fluent gRPC Interface PackageThis Python package contains the auto-generated gRPC Python interface files for
Fluent.InstallationProvided that these wheels have been published to public PyPI, they can be
installed with:pip install ansys-api-fluentOtherwise, see theBuildTo build the gRPC packages, run:pip install build
python -m buildThis will create both the source distribution containing just the protofiles
along with the wheel containing the protofiles and build Python interface
files.Note that the interface files are identical regardless of the version of Python
used to generate them, but the last pre-built wheel forgrpcio~=1.30was
Python 3.7, so to improve your build time, use Python 3.7 when building the
wheel.Manual DeploymentAfter building the packages, manually deploy them with:pip install twine
twine upload dist/*Note that this is automatically done through CI/CD.Automatic DeploymentThis repository contains GitHub CI/CD that enables the automatic building of
source and wheel packages for these gRPC Python interface files. By default,
these are built on PRs, the main branch, and on tags when pushing. Artifacts
are uploaded for each PR.To publicly release wheels to PyPI, ensure your branch is up-to-date and then
push tags. For example, for the versionv0.5.0.gittagv0.5.0
gitpush--tags
|
ansys-api-geometry
|
ansys-api-geometry gRPC Interface PackageThis repository provides the auto-generated gRPC Python interface files for
the Ansys Geometry Service.InstallationProvided that these wheels have been published to public PyPI, they can be
installed with:pip install ansys-api-geometryBuildTo build the gRPC packages, run:pip install build
python -m buildThis will create both the source distribution containing just the protofiles
along with the wheel containing the protofiles and build Python interface
files.Manual DeploymentAfter building the packages, manually deploy them with:pip install twine
twine upload dist/*Note that this is automatically done through CI/CD.Automatic DeploymentThis repository contains GitHub CI/CD that enables the automatic building of
source and wheel packages for these gRPC Python interface files. By default,
these are built on PRs, the main branch, and on tags when pushing. Artifacts
are uploaded for each PR.To publicly release wheels to PyPI, ensure your branch is up-to-date and then
push tags. For example, for the versionv0.5.0.gittagv0.5.0
gitpush--tags
|
ansys-api-mapdl
|
ansys-api-mapdl gRPC Interface PackageThis Python package contains the auto-generated gRPC Python interface files for
mapdl.InstallationProvided that these wheels have been published to public PyPI, they can be
installed with:pip install ansys-api-mapdlOtherwise, see theBuildTo build the gRPC packages, run:pip install build
python -m buildThis will create both the source distribution containing just the protofiles
along with the wheel containing the protofiles and build Python interface
files.Note that the interface files are identical regardless of the version of Python
used to generate them, but the last pre-built wheel forgrpcio~=1.17was
Python 3.7, so to improve your build time, use Python 3.7 when building the
wheel.Manual DeploymentAfter building the packages, manually deploy them with:pip install twine
twine upload dist/*Note that this is automatically done through CI/CD.Automatic DeploymentThis repository contains GitHub CI/CD that enables the automatic building of
source and wheel packages for these gRPC Python interface files. By default,
these are built on PRs, the main branch, and on tags when pushing. Artifacts
are uploaded for each PR.To publicly release wheels to PyPI, ensure your branch is up-to-date and then
push tags. For example, for the versionv0.5.0.gittagv0.5.0
gitpush--tags
|
ansys-api-mapdl-v0
|
ansys.api.mapdl.v0 gRPC Interface PackageThis Python package contains the auto-generated gRPC python interface files.Version: 0.4.1
Auto-generated on: 04:49:37 on 29 October 2021
|
ansys-api-mechanical
|
ansys-api-mechanical gRPC Interface PackageThis Python package contains the auto-generated gRPC Python interface files for
Mechanical.InstallationProvided that these wheels have been published to public PyPI, they can be
installed with:pip install ansys-api-mechanicalOtherwise, see theBuildTo build the gRPC packages, run:pip install build
python -m buildThis will create both the source distribution containing just the protofiles
along with the wheel containing the protofiles and build Python interface
files.Note that the interface files are identical regardless of the version of Python
used to generate them, but the last pre-built wheel forgrpcio~=1.30was
Python 3.7, so to improve your build time, use Python 3.7 when building the
wheel.Manual DeploymentAfter building the packages, manually deploy them with:pip install twine
twine upload dist/*Note that this is automatically done through CI/CD.Automatic DeploymentThis repository contains GitHub CI/CD that enables the automatic building of
source and wheel packages for these gRPC Python interface files. By default,
these are built on PRs, the main branch, and on tags when pushing. Artifacts
are uploaded for each PR.To publicly release wheels to PyPI, ensure your branch is up-to-date and then
push tags. For example, for the versionv0.5.0.gittagv0.5.0
gitpush--tags
|
ansys-api-meshing-prime
|
Ansys Prime Server gRPC Interface PackageThis Python package contains the auto-generated gRPC Python interface files for
Ansys Prime Server. Contributions for this API will not be accepted. Please
create an issue or discussion for questions or enhancements relating to this
project.InstallationProvided that these wheels have been published to public PyPI, they can be
installed with:pipinstallansys-api-meshing-primeBuildTo build the gRPC packages, run:pipinstallbuild
python-mbuild.This will create both the source distribution containing just the protofiles
along with the wheel containing the protofiles and build Python interface
files.Note that the interface files are identical regardless of the version of Python
used to generate them, but the last pre-built wheel forgrpcio~=1.46was
Python 3.10, so to improve your build time, use Python 3.10 when building the
wheel.Manual DeploymentAfter building the packages, manually deploy them with:pipinstalltwine
twineuploaddist/*Note that this is automatically done through CI/CD.Automatic DeploymentThis repository contains GitHub CI/CD that enables the automatic building of
source and wheel packages for these gRPC Python interface files. By default,
these are built on PRs, the main branch, and on tags when pushing. Artifacts
are uploaded for each PR.To publicly release wheels to PyPI, ensure your branch is up-to-date and then
push tags. For example, for the versionv0.1.2.gittagv0.1.2
gitpush--tags
|
ansys-api-modelcenter
|
ansys-api-modelcentergRPC Interface Package.This repository provides the auto-generated gRPC Python interface files for the Ansys ModelCenter.InstallationProvided that these wheels have been published to public PyPI, they can be
installed with:pip install ansys-api-modelcenterBuildTo build the gRPC packages, run:pip install build
python -m buildThis will create both the source distribution containing just the protofiles
along with the wheel containing the protofiles and build Python interface
files.Manual DeploymentAfter building the packages, manually deploy them with:pip install twine
twine upload dist/*Note that this is automatically done through CI/CD.Automatic DeploymentThis repository contains GitHub CI/CD that enables the automatic building of
source and wheel packages for these gRPC Python interface files. By default,
these are built on PRs, the main branch, and on tags when pushing. Artifacts
are uploaded for each PR.To publicly release wheels to PyPI, ensure your branch is up-to-date and then
push tags.gitcheckoutrelease/{new_version}gitmergemain
-->Bumptheversion
gitpushorigin
gittagv{new_version}gitpushoriginv{{new_version}
|
ansys-api-platform-instancemanagement
|
ansys-api-platform-instancemanagement gRPC Interface PackageThis Python package contains the auto-generated gRPC Python interface files for
the Product Instance Management (PIM) API.InstallationProvided that these wheels have been published to public PyPI, they can be
installed with this command:pip install ansys-api-platform-instancemanagementBuildTo build the gRPC packages, run this command:python -m buildThe preceding command creates both the source distribution containing only the PROTO files
and the wheel containing the PROTO files and build Python interface files.Note that the interface files are identical regardless of the version of Python
used to generate them, but the last pre-built wheel forgrpcio~=1.17was
Python 3.7. To improve your build time, use Python 3.7 when building the
wheel.Manual DeploymentAfter building the packages, manually deploy them with these commands:pip install twine
twine upload dist/*Note that this is automatically done through CI/CD.Automatic DeploymentThis repository contains GitHub CI/CD that enables the automatic building of
source and wheel packages for these gRPC Python interface files. By default,
these are built on PRs, the main branch, and on tags when pushing. Artifacts
are uploaded for each PR.To publicly release wheels to PyPI, ensure your branch is up-to-date and then
push tags. These commands provides an example for the versionv0.5.0.gittagv0.5.0
gitpush--tags
|
ansys-api-pyensight
|
ansys-api-pyensight gRPC Interface PackageThis Python package contains the auto-generated gRPC Python interface files for
PyEnSight. It also contains the xml stubs for the automated generation of the
ensight module in PyEnSight.InstallationProvided that these wheels have been published to public PyPI, they can be
installed with:pip install ansys-api-pyensightOtherwise, see theBuildTo build the gRPC packages, run:pip install build
python -m buildThis will create both the source distribution containing just the protofiles
along with the wheel containing the protofiles and build Python interface
files.Note that the interface files are identical regardless of the version of Python
used to generate them, but the last pre-built wheel forgrpcio~=1.17was
Python 3.8, so to improve your build time, use Python 3.8 when building the
wheel.Manual DeploymentAfter building the packages, manually deploy them with:pip install twine
twine upload dist/*Note that this is automatically done through CI/CD.Automatic DeploymentThis repository contains GitHub CI/CD that enables the automatic building of
source and wheel packages for these gRPC Python interface files. By default,
these are built on PRs, the main branch, and on tags when pushing. Artifacts
are uploaded for each PR.To publicly release wheels to PyPI, ensure your branch is up-to-date and then
push tags. For example, for the versionv0.5.0.gittagv0.5.0
gitpush--tags
|
ansys-api-sherlock
|
ansys-api-sherlock gRPC Interface PackageThis Python package contains the auto-generated gRPC Python interface files for
Sherlock.InstallationProvided that wheels have been published to public PyPI, you can install the latest package
with this command:pip install ansys-api-sherlockOtherwise, in the PySherlock documentation, see the instructions for downloading and installing
this package inInstall packages <https://sherlock.docs.pyansys.com/version/dev/getting_started/installation.html>_.Build packagesTo build the gRPC packages, run these commands:pip install build
python -m buildThe preceding commands create both the source distribution containing only the PROTO files
and the wheel containing the PROTO files and build Python interface files.Note that the interface files are identical regardless of the version of Python
used to generate them, but the last pre-built wheel forgrpcio~=1.17was
Python 3.7. To improve your build time, use Python 3.7 when building the
wheel.Manual deploymentAfter building the packages, manually deploy them with these commands:pip install twine
twine upload dist/*Note that this is automatically done through CI/CD.Automatic deploymentThis repository contains a.githubdirectory with theci.ymlworkflow
file. This file uses GitHub Actions to automatically build the
source and wheel packages for these gRPC Python interface files. By default,
these are built on PRs, the main branch, and on tags when pushing. Artifacts
are uploaded for each PR.To publicly release wheels to PyPI, ensure that your branch is up to date and then
push tags. For example, to push tags for versionv0.5.0, you would use these commands:gittagv0.5.0
gitpush--tags
|
ansys-api-systemcoupling
|
ansys-api-systemcoupling gRPC Interface PackageThis Python package contains the auto-generated gRPC Python interface files for
System Coupling.InstallationProvided that these wheels have been published to public PyPI, they can be
installed with:pip install ansys-api-systemcouplingBuildTo build the gRPC packages, run:pip install build
python -m buildThis will create both the source distribution containing just the protofiles
along with the wheel containing the protofiles and build Python interface
files.Note that the interface files are identical regardless of the version of Python
used to generate them, but the last pre-built wheel forgrpcio~=1.30was
Python 3.7, so to improve your build time, use Python 3.7 when building the
wheel.Manual DeploymentAfter building the packages, manually deploy them with:pip install twine
twine upload dist/*Note that this is automatically done through CI/CD.Automatic DeploymentThis repository contains GitHub CI/CD that enables the automatic building of
source and wheel packages for these gRPC Python interface files. By default,
these are built on PRs, the main branch, and on tags when pushing. Artifacts
are uploaded for each PR.To publicly release wheels to PyPI, ensure your branch is up-to-date and then
push tags. For example, for the versionv0.5.0.gittagv0.5.0
gitpush--tags
|
ansys-api-tools-filetransfer
|
ansys-api-tools-filetransfer gRPC Interface PackageThis Python package contains the auto-generated gRPC Python interface files for
the filetransfer tool.InstallationProvided that these wheels have been published to public PyPI, they can be
installed with:pip install ansys-api-tools-filetransferBuildTo build the gRPC packages, run:pip install build
python -m buildThis will create both the source distribution containing just the protofiles
along with the wheel containing the protofiles and build Python interface
files.Note that the interface files are identical regardless of the version of Python
used to generate them, but the last pre-built wheel forgrpcio~=1.17was
Python 3.7, so to improve your build time, use Python 3.7 when building the
wheel.Manual DeploymentAfter building the packages, manually deploy them with:pip install twine
twine upload dist/*Note that this is automatically done through CI/CD.Automatic DeploymentThis repository contains GitHub CI/CD that enables the automatic building of
source and wheel packages for these gRPC Python interface files. By default,
these are built on PRs, the main branch, and on tags when pushing. Artifacts
are uploaded for each PR.To publicly release wheels to PyPI, ensure your branch is up-to-date and then
push tags. For example, for the versionv0.5.0.gittagv0.5.0
gitpush--tags
|
ansys-corba
|
This python module provides minimum support for connecting to an ANSYS APDL server using Python. While it is designed to be used as a support module to supportpyansys, it can be used individually to send text commands to an APDL instance, but with none of the syntax checking or error handlingpyansysuses. In short, if you find yourself here, installpyansysunless you really want a quick and dirty solution to driving ANSYS APDL from Python.This module relies on documentation provided by ANSYS APDL and uses compiled libraries using both source file fromomniORB. See the shell files on the GitHubrepositoryfor Linux build instructions. Building for Windows was a nightmare.InstallationPre-compiled binary files are available for Python 2.7, 3.5, and 3.6 for Linux and Windows. Open anissueif you need another version. Python 3.7 is unavailable as the source isn’t compiling. Wait until 4.2.3 or greater is released. Contact the maintainer atomniORB.Installation is simply:pip install ansys_corbaUsageOnce again, you really should be usingpyansys. It handles figuring out where themapdl_broadcasts.txtfile is and when to open a connection with the server. If you’d rather live on the wild side, here’s how you’d open ANSYS, connect to a CORBA server, and send over a few commands:importsysimporttimeimportosfromansys_corbaimportCORBAimportsubprocess# edit this to match your ansys exeansys_loc='C:\\Program Files\\ANSYS Inc\\v170\\ansys\\bin\winx64\\ANSYS170.exe'# ansys apdl logging here:logfile='mapdl_broadcasts.txt'ifos.path.isfile(logfile):os.remove(logfile)# make temporary input file to stop ansys from prompting the userwithopen('tmp.inp','w')asf:f.write('FINISH')# start ANSYScommand='"%s" -aas -i tmp.inp -o out.txt -b'%ansys_locsubprocess.Popen(command,stdout=subprocess.PIPE)# monitor log file and wait for connectionprint('Starting ANSYS...')whileTrue:try:ifos.path.isfile(logfile):withopen(logfile,'r')asf:text=f.read()if'visited:collaborativecosolverunitior'intext:print('ANSYS started')breaktime.sleep(0.1)exceptKeyboardInterrupt:sys.exit()withopen('./aaS_MapdlId.txt')asf:key=f.read()# create serverorb=CORBA.ORB_init()mapdl=orb.string_to_object(key)# run simple commands to demonstrate this worksmapdl.executeCommand('/prep7')out=mapdl.executeCommandToString('cylind, 2, , , 2, 0, 90')print(out.replace('\\n','\n'))mapdl.executeCommand('FINISH')mapdl.terminate()# could use exit, but it returns an errorThere’s several things that could break here, for example, your path to ANSYS, or finding the mapdl_broadcasts.txt file. If this python script isn’t running in the same directory as ANSYS, it will hang until you kill the process or exit it with a keyboard interrupt.Further DocumentationOnce you’ve opened a connection to ANSYS, there’s really only three commands that you need to use. This documentation was shamelessly taken fromsharcnet.executeCommand:Issues a command to the connected Mechanical APDL session. Output from the command is not returned.executeCommandToStringIssues a command to the connected Mechanical APDL session and returns the output as a string.terminateTerminates the connected Mechanical APDL as a Server session.See thesharcnetdocumentation for more detailsNotesInstalling from source is not possible using PyPi as the shared libraries need to be compiled outside of Python. I’ve includeddocker_buildlinux.shanddocker.shwhich can be used to build the source code for Linux. Building for Windows is more complicated and requires following the readme within the omniorb source along with some trial and error.License and AcknowledgmentsThis code is licensed under the MIT license.This module,ansys_corbamakes no commercial claim over ANSYS whatsoever. This tool extends the functionality of ANSYS by adding a python interface in both file interface as well as interactive scripting without changing the core behavior or license of the original software. The use of the interactive APDL control ofansys_corbarequires a legally licensed local copy of ANSYS.Also, this module wouldn’t be possible withoutomniORBas most of the source code is directly take from omniORBpy with only minor modifications to the file structure and the addition of documentation specific to ANSYS.
|
ansys-dpf-composites
|
PyDPF Composites enables the post-processing of composite structures based onAnsys DPFand the DPF Composites plugin. So it is a Python wrapper which
implements classes on top of DPF Composites operators and data accessors for
short fiber and layered composites (layered shell and solid elements). This
module can be used to postprocess fiber reinforced plastics and layered
composites, and to implement custom failure criteria and computation. For
information demonstrating the behavior and usage of PyDPF Composites,
seeExamplesin the DPF Composite documentation.ContributeInstall in development modeInstalling PyDPF Composites in development mode allows
you to modify the source and enhance it.Before attempting to contribute to PyDPF Composites, ensure that you are thoroughly
familiar with thePyAnsys Developer’s Guide.Clone the repository:gitclonehttps://github.com/ansys/pydpf-compositescdpydpf-compositesInstall dependencies:python-mpipinstallpipxpipxensurepath# Minimum required poetry version is 1.2.0pipxinstallpoetrypipxinstallpippipxinstalltoxPyDPF Composites usesPoetryto manage the development environment.Create a virtual environment and install the package with the
development dependencies:poetryinstall--all-extrasActivate the virtual environment:poetryshellTestThere are different ways to run the PyDPF Composites tests, depending on how the DPF
server is started.Run tests with a Docker container:Follow the steps inGetting the DPF server Docker imageto get
and run the DPF docker image. Run the tests with the following commandpytest.--port50052Run tests with a DPF server started from the Ansys installer. The Ansys version must
be 2023 R2 or later.pytest.--ansys-path"C:\Program Files\Ansys Inc\v232"Run tests with a Docker container from Github (Ansys Internal only):dockerpullghcr.io/ansys/pydpf-composites:latestpytest.Build documentationFollow the description inGetting the DPF server Docker imageimage to get
and run the dpf docker image.On Windows, build the documentation with:tox-edoc-windowsOn Linux, build the documentation with:tox-edoc-linuxAnsys internal only: Build the docs with the latest container from Github:dockerpullghcr.io/ansys/pydpf-composites:latestdockerrun-d-p50052:50052-eANSYSLMD_LICENSE_FILE=1055@mylicserver-eANSYS_DPF_ACCEPT_LA=Yghcr.io/ansys/pydpf-composites:latesttox-edoc-windowsRun style checksThe style checks usepre-commitand can be run throughtox:tox-estyleThe style checks can also be configured to run automatically before eachgit commit:pre-commitinstallView documentationDocumentation for the latest stable release of PyDPF Composites is hosted atPyDPF Composites Documentation.In the upper right corner of the documentation’s title bar, there is an option
for switching from viewing the documentation for the latest stable release
to viewing the documentation for the development version or previously
released versions.
|
ansys-dpf-core
|
DPF - Ansys Data Processing FrameworkAnsys Data Processing Framework (DPF) provides numerical simulation
users and engineers with a toolbox for accessing and transforming simulation
data. With DPF, you can perform complex preprocessing or postprocessing of
large amounts of simulation data within a simulation workflow.DPF is an independent, physics-agnostic tool that you can plug into many
apps for both data input and data output, including visualization and
result plots. It can access data from solver result files and other neutral
formats, such as CSV, HDF5, and VTK files.The latest version of DPF supports Ansys solver results files for:Mechanical APDL (.rst,.mode,.rfrq,.rdsp)LS-DYNA (.d3plot,.binout)Fluent (.cas/dat.h5,.flprj)CFX (.cad/dat.cff,.flprj)For more information on file support, see themain pagein the PyDPF-Core documentation.Using the many DPF operators that are available, you can manipulate and
transform this data. You can also chain operators together to create simple
or complex data-processing workflows that you can reuse for repeated or
future evaluations.The data in DPF is defined based on physics-agnostic mathematical quantities
described in self-sufficient entities calledfields. This allows DPF to be
a modular and easy-to-use tool with a large range of capabilities.Theansys.dpf.corepackage provides a Python interface to DPF, enabling
rapid postprocessing of a variety of Ansys file formats and physics solutions
without ever leaving the Python environment.Documentation and issuesDocumentation for the latest stable release of PyDPF-Core is hosted atPyDPF-Core documentation.In the upper right corner of the documentation's title bar, there is an option for switching from
viewing the documentation for the latest stable release to viewing the documentation for the
development version or previously released versions.You can alsoviewordownloadthe
PyDPF-Core cheat sheet. This one-page reference provides syntax rules and commands
for using PyDPF-Core.On thePyDPF-Core Issuespage,
you can create issues to report bugs and request new features. On thePyDPF-Core Discussionspage or theDiscussionspage on the Ansys Developer portal, you can post questions, share ideas, and get community feedback.To reach the project support team, [email protected] requires DPF to be available. You can either have a compatible Ansys version installed
or install the standaloneansys-dpf-serverserver package. For more information, seeGetting Started with DPF Serverin the PyDPF-Core documentation.For the compatibility between PyDPF-Core and Ansys, seeCompatibilityin
the PyDPF-Core documentation.To use PyDPF-Core with theansys-dpf-serverserver package or with Ansys 2022 R2 or later,
install the latest version with this command:pip install ansys-dpf-corePyDPF-Core plotting capabilities requirePyVista <https://pyvista.org/>_ to be installed.
To install PyDPF-Core with its optional plotting functionalities, use this command:pip install ansys-dpf-core[plotting]For more information on PyDPF-Core plotting capabilities, seePlotin the PyDPF-Core documentation.To use PyDPF-Core with Ansys 2022 R1, install the latest compatible version
with this command:pip install ansys-dpf-core<0.10.0To use PyDPF-Core with Ansys 2021 R2, install the latest compatible version
with this command:pip install ansys-grpc-dpf<0.4.0; pip install ansys-dpf-core<0.10.0To use PyDPF-Core with Ansys 2021 R1, install the latest compatible version
with this command:pip install ansys-grpc-dpf<0.3.0; pip install ansys-dpf-core<0.3.0Brief demoProvided you have DPF available, a DPF server automatically starts once you start using PyDPF-Core.To open a result file and explore what's inside, use this code:>>>fromansys.dpfimportcoreasdpf>>>fromansys.dpf.coreimportexamples>>>model=dpf.Model(examples.find_simple_bar())>>>print(model)DPF Model------------------------------Static analysisUnit system: Metric (m, kg, N, s, V, A)Physics Type: MechanicalAvailable results:- displacement: Nodal Displacement- element_nodal_forces: ElementalNodal Element nodal Forces- elemental_volume: Elemental Volume- stiffness_matrix_energy: Elemental Energy-stiffness matrix- artificial_hourglass_energy: Elemental Hourglass Energy- thermal_dissipation_energy: Elemental thermal dissipation energy- kinetic_energy: Elemental Kinetic Energy- co_energy: Elemental co-energy- incremental_energy: Elemental incremental energy- structural_temperature: ElementalNodal Temperature------------------------------DPF Meshed Region:3751 nodes3000 elementsUnit: mWith solid (3D) elements------------------------------DPF Time/Freq Support:Number of sets: 1Cumulative Time (s) LoadStep Substep1 1.000000 1 1Read a result with this command:>>>result=model.results.displacement.eval()Then, start connecting operators with this code:>>>fromansys.dpf.coreimportoperatorsasops>>>norm=ops.math.norm(model.results.displacement())Starting the serviceTheansys.dpf.corelibrary automatically starts a local instance of the DPF service in the
background and connects to it. If you need to connect to an existing
remote or local DPF instance, use theconnect_to_servermethod:>>>fromansys.dpfimportcoreasdpf>>>dpf.connect_to_server(ip='10.0.0.22',port=50054)Once connected, this connection remains for the duration of the
module. It closes when you exit Python or connect to a different server.License and acknowledgmentsPyDPF-Core is licensed under the MIT license. For more information, see theLICENSEfile.PyDPF-Core makes no commercial claim over Ansys whatsoever. This library
extends the functionality of Ansys DPF by adding a Python interface
to DPF without changing the core behavior or license of the original
software.
|
ansys-dpf-gate
|
ansys-dpf-gate: DPF (Ansys Data Processing Framework) python helpers to call DPF C and gRPC APIsThis module is designed to provide helper APIs to call C functions from DPFClientAPI (.dll or .so)
from python.
DPFClientAPI is a dynamic library providing C APIs to create, access and modify DPF's objects "in process"
(sharing memory) and/or in "client/server" mode through gRPC. DPFClientAPI wraps and makes easier the switch
between the 2 modes of communication.To allow for backward compatibility with old DPF Servers (strictly older than Ansys 2022 R2), which didn't have a DPFClientAPI,
an implementation of ansys-dpf-capi functions is done with direct calls to ansys-grpc-dpf (dpf grpc python module which
directly communicates with DPF server).
|
ansys-dpf-gatebin
|
ansys-dpf-gatebin: DPF (Ansys Data Processing Framework) C++ APIs librariesThis module is providing runtime OS dependent binaries dependencies for ansys-dpf-gate. The DPF APIs DPFClientAPI (.dll or .so) and Ans.Dpf.GrpcClient (.dll or .so) are packaged.DPFClientAPI is a dynamic library providing C APIs to create, access and modify DPF's objects "in process" (sharing memory) and/or in "client/server" mode through gRPC, using Ans.Dpf.GrpcClient.
|
ansys-dpf-post
|
PyDPF-Post - Ansys Data PostProcessing FrameworkAnsys Data Processing Framework (DPF) provides numerical simulation
users and engineers with a toolbox for accessing and transforming simulation
data. With DPF, you can perform complex preprocessing or postprocessing of
large amounts of simulation data within a simulation workflow.The Pythonansys-dpf-postpackage provides a high-level, physics-oriented
API for postprocessing. Loading a simulation (defined by its results files)
allows you to extract simulation metadata and results and then apply
postprocessing operations on them.The latest version of DPF supports Ansys solver results files for:Mechanical APDL (.rst,.mode,.rfrq,.rdsp)LS-DYNA (.d3plot,.binout)Fluent (.cas/dat.h5,.flprj)CFX (.cad/dat.cff,.flprj)For more information on file support, see themain pagein the PyDPF-Core documentation.PyDPF-Post leverages the PyDPF-Core project'sansys-dpf-corepackage, which is
available atPyDPF-Core GitHub.
Use theansys-dpf-corepackage for building more advanced and customized workflows
using Ansys DPF.Documentation and issuesDocumentation for the latest stable release of PyPDF-Post is hosted atPyDPF-Post documentation.In the upper right corner of the documentation's title bar, there is an option for switching from
viewing the documentation for the latest stable release to viewing the documentation for the
development version or previously released versions.You can alsoviewordownloadthe
PyDPF-Post cheat sheet. This one-page reference provides syntax rules and commands
for using PyDPF-Post.On thePyDPF-Post Issuespage,
you can create issues to report bugs and request new features. On thePyDPF-Post Discussionspage or theDiscussionspage on the Ansys Developer portal, you can post questions, share ideas, and get community feedback.To reach the project support team, [email protected] install this package, run this command:pip install ansys-dpf-postYou can also clone and install this package with these commands:git clone https://github.com/ansys/pydpf-post
cd pydpf-post
pip install . --userBrief demoProvided you have Ansys 2023 R1 or later installed, a DPF server automatically starts
once you start using PyDPF-Post.To load a simulation for a MAPDL result file to extract and
postprocess results, use this code:>>>fromansys.dpfimportpost>>>fromansys.dpf.postimportexamples>>>simulation=post.load_simulation(examples.download_crankshaft())>>>displacement=simulation.displacement()>>>print(displacement)results U (m)set_ids 3node_ids components4872 X -3.4137e-05Y 1.5417e-03Z -2.6398e-069005 X -5.5625e-05Y 1.4448e-03Z 5.3134e-06... ... ...>>>displacement.plot()>>>stress_eqv=simulation.stress_eqv_von_mises_nodal()>>>stress_eqv.plot()To run PyDPF-Post with Ansys 2021 R1 through 2022 R2, use this code to
start the legacy PyDPF-Post tools:>>>fromansys.dpfimportpost>>>fromansys.dpf.postimportexamples>>>solution=post.load_solution(examples.download_crankshaft())>>>stress=solution.stress()>>>stress.eqv.plot_contour(show_edges=False)License and acknowledgementsPyDPF-Post is licensed under the MIT license. For more information, see theLICENSEfile.PyDPF-Post makes no commercial claim over Ansys whatsoever. This library
extends the functionality of Ansys DPF by adding a Python interface
to DPF without changing the core behavior or license of the original
software.
|
ansys-dyna-core
|
PyDYNAOverviewPyDYNA is a Pythonic package for providing a more convenient and complete way to
build an Ansys DYNA input deck, submit it to the Ansys LS-DYNA solver, and
finally postprocess the results.PyDYNA contains two submodules,ansys.dyna.core.preandansys.dyna.core.solverpre: This module provides highly abstracted APIs for creating and
setting up DYNA input decks. There are many classes supported, namely,
DynaMech, DynaIGA, DynaICFD, DynaSALE, DynaEM,DynaNVH, DynaMaterial,
DynaISPH, DynaICFD and DynaAirbag. Each of these classes can be used to generate
LS-DYNA keywords. Since these classes have high-level abstraction, each function call
generates groups of keywords needed to define an input in LS-DYNA.solver: This API provides features to interact directly with the Ansys LS-DYNA solver.
LS-DYNA is primarily a batch solver with very limited interactive capabilities, thesolverservice provides a way to push input files to the LS-DYNA solver, monitor the state
of the running job, change the value of a load curve and finally retrieve result files back from
the serverOnce you have results, you can use the Ansys Data Processing Framework (DPF),
which is designed to provide numerical simulation users and engineers
with a toolbox for accessing and transforming simulation data. DPF
can access data from Ansys solver files and from several files with neutral formats,
including CSV, HDF5, and VTK. Using DPF’s various operators,
you can manipulate and transform this data.Theansys-dpf-post packageprovides
a simplified Python interface to DPF, thus enabling rapid postprocessing
without ever leaving a Python environment. For more information on DPF-Post,
see theDPF-Post documentation.Documentation and issuesDocumentation for the latest stable release of PyDyna is hosted atPyDYNA documentation.For examples on how to use PyDYNA, seeExamplesin the PyDYNA documentation.In the upper right corner of the documentation’s title bar, there is an option for switching from
viewing the documentation for the latest stable release to viewing the documentation for the
development version or previously released versions.On thePyDYNA Issuespage, you can create issues to
report bugs and request new features. On thePyDYNA Discussionspage or theDiscussionspage on the Ansys Developer portal,
you can post questions, share ideas, and get community feedback.To reach the project support team, [email protected] is licensed under the MIT license.PyDYNA makes no commercial claim over Ansys whatsoever. This library extends the functionality of
Ansys LS-DYNA by adding a Python interface to LS-DYNA without changing the core behavior or
license of the original software. The use of the interactive control of PyDYNA requires a legally
licensed local copy of LS-DYNA.For more information on LS-DYNA, see theAnsys LS-DYNApage on the Ansys website.
|
ansys-dynamicreporting-core
|
OverviewPyDynamicReporting is the Python client library for Ansys Dynamic Reporting,
previously documented asNexus. Ansys Dynamic Reporting is a service for
pushing items of many types, including images, text, 3D scenes, and tables,
into a database, where you can keep them organized and create dynamic reports
from them. When you use PyDynamicReporting to connect to an instance of
Ansys Dynamic Reporting, you have a Pythonic way of accessing all capabilities
of Ansys Dynamic Reporting.Documentation and issuesDocumentation for the latest stable release of PyDynamicReporting is hosted atPyDynamicReporting documentation.In the upper right corner of the documentation’s title bar, there is an option
for switching from viewing the documentation for the latest stable release
to viewing the documentation for the development version or previously
released versions.You can alsoviewordownloadthe
PyDynamicReporting cheat sheet. This one-page reference provides syntax rules and commands
for using PyDynamicReporting.On thePyDynamicReporting Issuespage, you can create issues to report bugs and request new features. On theDiscussionspage on the Ansys Developer portal, you can post questions, share ideas, and get community feedback.To reach the project support team, emailpyansys.core@ansys.com.InstallationThepydynamicreportingpackage supports Python 3.9 through 3.12 on
Windows and Linux. It is currently available on the PyPirepository.To install the package, simply runpip install ansys-dynamicreporting-coreAlternatively, the user can download the repository and locally build the
package. Two modes of installation are available:Developer installationUser installationThe code provided for both installation modes use avirtual environment.Developer installationTo clone and install thepydynamicreportingpackage in development mode,
run this code:git clone https://github.com/ansys/pydynamicreporting
cd pydynamicreporting
pip install virtualenv
virtualenv venv # create virtual environment
source venv/bin/activate # (.\venv\Scripts\activate for Windows shell)
make install-dev # install pydynamicreporting in editable modeThe preceding code creates an “editable” installation that lets you develop and test
PyDynamicReporting at the same time.User installationTo build and create a production-like installation for use, run this code:make clean # clean
make build # build
# this replaces the editable installation done previously. If you don't want to replace,
# switch your virtual environments to test the new install separately.
make install
# you can skip the steps above and just do 'make all'
make smoketest # test importPre-commit setuppre-commitis a framework for managing and
maintaining multi-language pre-commit hooks.To install thepre-commitpackage into your Git hooks, run this command:pre-commit installpre-commitnow runs on every commit.Each time you clone a project, installing thepre-commitpackage
should always be the first thing that you do.If you want to manually run all pre-commit hooks on a repository, run
this command:pre-commit run --all-filesThe preceding command runs a bunch of formatters on your source files.To run an individual hook, obtain the hook ID from the project’s.pre-commit-config.yamlfile and then run this code,
where<hook_id>is the obtained ID:pre-commit run <hook_id>The first timepre-commitruns on a file, it automatically downloads,
installs, and runs the hook.Local GitHub ActionsTo run GitHub Actions on your local desktop (recommended), install theactpackage.To run a job, such as thedocsjob from theci_cd.ymlfile, use
this command, wheredocsis the job name:act -j docsDeploy and upload stepsmust alwaysbe ignored. If they are not ignored,
before running GitHub Actions locally, addif: ${{ !env.ACT }}to the
workflow step and commit this change if required.DependenciesTo use PyDynamicReporting, you must have a locally installed and licensed copy
of Ansys 2023 R2 or later.Basic usageThis code shows how to start the simplest PyDynamicReporting session:>>>importansys.dynamicreporting.coreasadr>>>adr_service=adr.Service(ansys_installation=r"C:\Program Files\ANSYS Inc\v232")>>>ret=adr_service.connect()>>>my_img=adr_service.create_item()>>>my_img.item_image="image.png">>>adr_service.visualize_report()License and acknowledgementsPyDynamicReporting is licensed under the MIT license.PyDynamicReporting makes no commercial claim over Ansys whatsoever.
This library extends the functionality of Ansys Dynamic Reporting by
adding a Python interface to Ansys Dynamic Reporting without changing
the core behavior or license of the original software. The use of
PyDynamicReporting requires a legally licensed copy of an Ansys product
that supports Ansys Dynamic Reporting.To get a copy of Ansys, visit theAnsyswebsite.
|
ansys-edb-core
|
PyEDB-Core is a Python client for the Electronics Database (EDB), a format for storing
information describing designs for Ansys Electronic Desktop (AEDT). Using the PyEDB-Core API,
you can make calls to an EDB server that is running either locally or remotely.The EDB server can create, edit, read, and write EDB files to disk. These files can then be
read into AEDT and their designs simulated.Documentation and issuesDocumentation for the latest stable release of PyEDB-Core is hosted atPyEDB-Core documentation.
The documentation has five sections:Getting started: Describes
how to install PyEDB-Core in user mode.User guide: Describes how to
use PyEDB-Core.API reference: Provides API member descriptions
and usage examples.Examples: Provides examples showing
end-to-end workflows for using PyEDB-Core.Contribute: Describes how to install
PyEDB-Core in developer mode and how to contribute to this PyAnsys library.In the upper right corner of the documentation’s title bar, there is an option for switching from
viewing the documentation for the latest stable release to viewing the documentation for the
development version or previously released versions.On thePyEDB-Core Issuespage, you can create
issues to report bugs and request new features. When possible, use these issue templates:Bug report templateFeature request templateDocumentation issue templateExample request templateIf your issue does not fit into one of these categories, create your own issue.On theDiscussionspage on the Ansys Developer portal, you can post questions,
share ideas, and get community feedback.To reach the PyAnsys support team, [email protected] is licensed under the MIT license.PyEDB-Core makes no commercial claim over Ansys whatsoever. The use of this Python client requires
a legally licensed copy of AEDT. For more information, see theAnsys Electronicspage on the Ansys website.
|
ansys-fluent-core
|
OverviewPyFluent provides Pythonic access to Ansys Fluent. Its features enable the seamless use of
Fluent within the Python ecosystem and broad access to native Fluent features, including the
ability to:Launch Fluent using a local Ansys installationUse Fluent’s TUI (text user interface) commands for both meshing and solver featuresUse Fluent’s built-in postprocessing capabilitiesDocumentation and issuesDocumentation for the latest stable release of PyFluent is hosted atPyFluent documentation.In the upper right corner of the documentation’s title bar, there is an option for switching from
viewing the documentation for the latest stable release to viewing the documentation for the
development version or previously released versions.You can alsoviewordownloadthe
PyFluent cheat sheet. This one-page reference provides syntax rules and commands
for using PyFluent.On thePyFluent Issuespage, you can create
issues to report bugs and request new features. On thePyFluent Discussionspage or theDiscussionspage on the Ansys Developer portal, you can post questions, share ideas, and get community feedback.To reach the project support team, emailpyansys.core@ansys.com.InstallationTheansys-fluent-corepackage supports Python 3.9 through Python
3.11 on Windows and Linux.Install the latest release fromPyPIwith:pip install ansys-fluent-coreFor developersIf you plan on doing localdevelopmentof PyFluent with Git, install
the latest release with:git clone https://github.com/ansys/pyfluent.git
cd pyfluent
pip install pip -U
pip install -e .
python codegen/allapigen.py # Generates the API filesDependenciesYou must have a licensed copy of Ansys Fluent installed locally. PyFluent
supports Fluent 2022 R2 and later. The Windows installation of Ansys Fluent automatically
sets the required environment variables so that PyFluent can find the Ansys Fluent
installation. Using Fluent 2023 R2 (or 23.2) installed in the default directory as an
example, the installer automatically sets theAWP_ROOT232environment variable to point
toC:\ProgramFiles\ANSYS Inc\v232.On Linux, the required environment variable is not set automatically, and can be set for the
current user in the current shell session, using Fluent 2023 R1 in the default installation
directory as an example, before running PyFluent, with:export AWP_ROOT232=/usr/ansys_inc/v232For this setting to persist between different shell sessions for the current user, the same
export command can instead be added to the user’s~/.profilefile.Getting startedLaunching FluentTo launch Fluent from Python, use thelaunch_fluentmethod:importansys.fluent.coreaspyfluentsolver_session=pyfluent.launch_fluent(mode="solver")solver_session.health_check_service.is_servingBasic usageYou can use thesolver_session.tuiinterface to run all Fluent TUI commands:solver_session.tui.file.read_case('elbow.cas.h5')solver_session.tui.define.models.unsteady_2nd_order("yes")solver_session.tui.solve.initialize.initialize_flow()solver_session.tui.solve.dual_time_iterate(2,3)You can also install and use these PyFluent libraries:PyFluent Parametric, which provides
access to Fluent’s parametric workflows.PyFluent Visualization, which
provides postprocessing and visualization capabilities using thepyvistaandmatplotlibpackages.License and acknowledgmentsPyFluent is licensed under the MIT license.PyFluent makes no commercial claim over Ansys whatsoever. This library
extends the functionality of Ansys Fluent by adding a Python interface
to Fluent without changing the core behavior or license of the original
software. The use of the interactive Fluent control of PyFluent requires a
legally licensed local copy of Fluent.For more information on Fluent, see theAnsys Fluentpage on the Ansys website.
|
ansys-fluent-parametric
|
OverviewPyFluent-Parametric provides Pythonic access to Ansys Fluent’s parametric
workflows.Documentation and issuesFor comprehensive information on PyFluent-Parametric, see the latest
releasedocumentation.On thePyFluent-Parametric Issues,
you can create issues to submit questions, report bugs, and request new features. To reach
the project support team, emailpyansys.core@ansys.com.InstallationTheansys-fluent-parametricpackage currently supports Python 3.9 through Python
3.11 on Windows and Linux.Install the latest release fromPyPIwith:pip install ansys-fluent-parametricAlternatively, install the latest fromGitHubwith:pip install git+https://github.com/ansys/pyfluent-parametric.gitIf you plan on doing localdevelopmentof PyFluent with Git, install
with:git clone https://github.com/ansys/pyfluent-parametric.git
cd pyfluent-parametric
pip install pip -U
pip install -e .DependenciesYou must have a locally-installed, licensed copy of Ansys to run Fluent. The
first supported version is 2022 R2.Getting startedBasic usageThe following code assumes that a PyFluent session has already been created and a Fluent case
with input parameters has been set up. For a full example, seeDefining Parametric Workflowsin
the PyFluent-Parametric documentation.importansys.fluent.coreaspyfluentfromansys.fluent.parametricimportParametricStudysolver_session=pyfluent.launch_fluent(mode="solver")study=ParametricStudy(solver_session.parametric_studies)input_parameters_update=study.design_points["Base DP"].input_parametersinput_parameters_update["inlet1_vel"]=0.5study.design_points["Base DP"].input_parameters=input_parameters_updatestudy.update_current_design_point()print(study.design_points["Base DP"].output_parameters)License and acknowledgmentsPyFluent-Parametric is licensed under the MIT license.PyFluent-Parametric makes no commercial claim over Ansys whatsoever. This library
extends the functionality of Fluent by adding a Python interface to Fluent without
changing the core behavior or license of the original software. The use of the
interactive Fluent control of PyFluent-Parametric requires a legally licensed
local copy of Fluent.For more information, see theAnsys Fluent <https://www.ansys.com/products/fluids/ansys-fluent>page on the Ansys website.
|
ansys-fluent-visualization
|
OverviewPyFluent-Visualization provides postprocessing and visualization
capabilities forPyFluentusingPyVistaandMatplotlib.Documentation and issuesFor comprehensive information on PyFluent-Visualization, see the latest releasedocumentation.In the upper right corner of the documentation’s title bar, there is an option
for switching from viewing the documentation for the latest stable release
to viewing the documentation for the development version or previously
released versions.On thePyFluent Visualization Issuespage, you can create
issues to submit questions, reports burgs, and request new features. To reach
the project support team, emailpyansys.core@ansys.com.InstallationTheansys-fluent-visualizationpackage supports Python 3.9 through Python
3.11 on Windows and Linux.If you are using Python 3.10, download and install the wheel file for thevtkpackage fromhere for Windowsor fromhere for Linux.Install the latest release fromPyPIwith:pip install ansys-fluent-visualizationAlternatively, install the latest release fromGitHubwith:pip install git+https://github.com/ansys/pyfluent-visualization.gitIf you plan on doing localdevelopmentof PyFluent-Visualization with Git,
install with:git clone https://github.com/ansys/pyfluent-visualization.git
cd pyfluent-visualization
pip install pip -U
pip install -e .DependenciesYou must have a licensed copy of Ansys Fluent installed locally.
PyFluent-Visualization supports Ansys Fluent 2022 R2 and
later.Getting startedBasic usageThe following code assumes that a PyFluent session has already been created
and a Fluent case with input parameters has been set up. For a complete
example, seeAnalyzing your resultsin
the PyFluent-Visualization documentation.fromansys.fluent.visualization.pyvistaimportGraphicsgraphics=Graphics(session=session)temperature_contour=graphics.Contours["contour-temperature"]temperature_contour.field="temperature"temperature_contour.surfaces_list=["in1","in2","out1"]temperature_contour.display("window-1")Usage in a JupyterLab environmentPyFluent-Visualization uses PyVista, which has the ability to display fully
featured plots within a JupyterLab environment using ipyvtklink. Find out
about using ipyvtklink with PyVistahere <https://docs.pyvista.org/user-guide/jupyter/ipyvtk_plotting.html>License and acknowledgmentsPyFluent-Visualization is licensed under the MIT license.PyFluent-Visualization makes no commercial claim over Ansys
whatsoever. This tool extends the functionality of Ansys Fluent
by adding a Python interface to Fluent without changing the
core behavior or license of the original software. The use of the
interactive Fluent control of PyFluent-Visualization requires
a legally licensed local copy of Fluent.For more information on Fluent, visit theFluentpage on the Ansys website.
|
ansys-geometry-core
|
ContentsOverviewInstallationBasic usageDocumentation and issuesOverviewPyAnsys Geometry is a Python client library for the Ansys Geometry service, as well as other CAD Ansys products
such as Ansys Discovery and Ansys SpaceClaim.InstallationYou can usepipto install PyAnsys Geometry.pipinstallansys-geometry-coreTo install the latest development version, run these commands:gitclonehttps://github.com/ansys/pyansys-geometrycdpyansys-geometrypipinstall-e.For more information, seeGetting Started.Basic usageThis code shows how to import PyAnsys Geometry and use some basic capabilities:fromansys.geometry.coreimportlaunch_modelerfromansys.geometry.core.designerimportDesignFileFormatfromansys.geometry.core.mathimportPlane,Point3D,Point2Dfromansys.geometry.core.miscimportUNITS,Distancefromansys.geometry.core.sketchimportSketch# Define a sketchorigin=Point3D([0,0,10])plane=Plane(origin,direction_x=[1,0,0],direction_y=[0,1,0])# Create a sketchsketch=Sketch(plane)sketch.circle(Point2D([1,1]),30*UNITS.m)sketch.plot()# Start a modeler sessionmodeler=launch_modeler()# Create a designdesign=modeler.create_design("ModelingDemo")# Create a body directly on the design by extruding the sketchbody=design.extrude_sketch(name="CylinderBody",sketch=sketch,distance=Distance(80,unit=UNITS.m))# Plot the bodydesign.plot()# Download the modeldesign.download(file_location="file.scdocx",format=DesignFileFormat.SCDOCX)For comprehensive usage information, seeExamplesin thePyAnsys Geometry documentation.Documentation and issuesDocumentation for the latest stable release of PyAnsys Geometry is hosted atPyAnsys Geometry documentation.In the upper right corner of the documentation’s title bar, there is an option for switching from
viewing the documentation for the latest stable release to viewing the documentation for the
development version or previously released versions.On thePyAnsys Geometry Issuespage,
you can create issues to report bugs and request new features. On thePyAnsys Geometry Discussionspage or theDiscussionspage on the Ansys Developer portal, you can post questions, share ideas, and get community feedback.To reach the project support team, [email protected].
|
ansys-grantami-bomanalytics
|
ansys-grantami-bomanalyticsProject OverviewPyGranta BoM Analytics is part of the largerPyAnsyseffort to facilitate the use of Ansys technologies directly from Python.The MI Restricted Substances and MI Sustainability solutions for Granta MI include REST APIs for:Evaluating compliance of products, assemblies, specifications, and
materials against legislations.Evaluating the environmental performance of products, assemblies, materials and processes.This package abstracts automatically-generated code into an easy-to-use client library.InstallationInstall theansys-grantami-bomanalyticspackage with this code:pip install ansys-grantami-bomanalyticsTo install a release compatible with a specific version of Granta MI, use thePyGrantameta-package with a requirement specifier:pip install pygranta==2023.2.0Alternatively, clone and install this package with this code:git clone https://github.com/ansys/grantami-bomanalytics
cd grantami-bomanalytics
pip install .DocumentationThePyGranta BoM Analytics Documentationprovides comprehensive installation and usage information.UsageHere’s a brief example of how to use PyGranta BoM Analytics:# Connect and query the Granta service.>>>frompprintimportpprint>>>fromansys.grantami.bomanalyticsimportConnection,queries>>>cxn=Connection("http://my_grantami_server/mi_servicelayer").with_autologon().connect()>>>query=(...queries.MaterialImpactedSubstancesQuery()....with_material_ids(['plastic-abs-pvc-flame'])....with_legislation_ids(['Candidate_AnnexXV'])...)# Print out the result from the query.>>>result=cxn.run(query)>>>pprint(result.impacted_substances)[<ImpactedSubstance:{"cas_number":10108-64-2,"percent_amount":1.9}>,<ImpactedSubstance:{"cas_number":107-06-2,"percent_amount":None}>,<ImpactedSubstance:{"cas_number":115-96-8,"percent_amount":15.0}>,...TestingFor information on testing, see theContributingsection of the documentation.LicensePyGranta BoM Analytics is provided under the terms of the MIT license. You can find
this license in the LICENSE file at the root of the repository.
|
ansys-grantami-bomanalytics-openapi
|
Project OverviewAutogenerated client library for the Granta MI BoM Analytics Services.Direct use of this package is unsupported, please useansys-grantami-bomanalyticsinstead.This Python package is automatically generated by theSwagger Codegenproject.LicenseThe library is provided under the terms of the MIT license. You can find
the license text in the LICENSE file at the root of the repository.
|
ansys-grantami-recordlists
|
PyGranta RecordListsA Python wrapper for the Granta MI Lists API.To avoid ambiguity with the Python objectlist, lists available via the Granta MI Lists API are referred to asrecord lists. Granta MI users might also know the feature asFavorites Lists.Using the Granta MI Lists API requires the user to have necessary permissions on the Granta MI Server. Some
operations on record lists require additional permissions, specific to record lists. For more information,
see the Help for the Favorites app in Granta MI.DependenciesTo use theansys.grantami.recordlistspackage you must have access to a Granta MI 2023 R2 deployment.Theansys.grantami.recordlistspackage currently supports Python from version 3.9 to version 3.12.InstallationTo install the latest release fromPyPI, use
this code:pip install ansys-grantami-recordlistsTo install a release compatible with a specific version of Granta MI, use thePyGrantameta-package with a requirement specifier:pip install pygranta==2023.2.0Alternatively, to install the latest fromansys-grantami-recordlistsGitHub,
use this code:pip install git:https://github.com/ansys/grantami-recordlists.gitTo install a localdevelopmentversion with Git and Poetry, use this code:git clone https://github.com/ansys/grantami-recordlists
cd grantami-recordlists
poetry installThe preceding code installs the package and allows you to modify it locally,
with your changes reflected in your Python setup after restarting the Python kernel.
|
ansys-grantami-serverapi-openapi
|
Project OverviewAutogenerated client library for the Granta MI Server API.Direct use of this package is unsupported, please useansys-grantami-recordlistsinstead.This Python package is automatically generated by theSwagger Codegenproject.LicenseThe library is provided under the terms of the MIT license. You can find
the license text in the LICENSE file at the root of the repository.
|
ansys-grpc-dpf
|
This module contains the python gRPC client for ansys-dpf-gate (dependency of ansys-dpf-core). It communicates directly with the DPF server. It allows backward compatibility with old DPF servers (strictly older than Ansys 2022 R2).
|
ansys-grpc-mapdl
|
No description available on PyPI.
|
ansys-hps-client
|
PyHPS is a Python client library for Ansys HPC Platform Services (HPS), which is
a set of technology components designed to help you manage the execution of simulations
while making use of your full range of computing assets.PyHPS brings Ansys HPS to your Python app. Wrapping around Ansys HPS REST APIs, PyHPS
allows you to:Create projects and modify existing ones.Monitor and manage jobs.Run your own design exploration algorithms.Retrieve simulation results.Documentation and issuesDocumentation for the latest stable release of PyHPS is hosted atPyHPS documentation.In the upper right corner of the documentation’s title bar, there is an option
for switching from viewing the documentation for the latest stable release
to viewing the documentation for the development version or previously
released versions.The PyHPS documentation contains these sections:Getting started: Explains
how to install PyHPS in user mode.User guide: Describes the basics
of how to use PyHPS to interact with Ansys HPS.Examples: Provides examples of how
to interact with Ansys HPS in Python using PyHPS.API reference: Describes PyHPS functions,
classes, methods, and their parameters and return values so that you can understand how to
interact with them programmaticallyContribute: Provides information on
how to install PyHPS in developer mode and make contributions to the codebase and documentation.On thePyHPS Issuespage, you can
create issues to report bugs and request new features. On thePyHPS Discussionspage or theDiscussionspage on the Ansys Developer portal,
you can post questions, share ideas, and get community feedback.To reach the project support team, [email protected] is licensed under the MIT license.PyHPS makes no commercial claim over Ansys whatsoever. This library extends the
functionality of Ansys HPC Platform Services by adding a Python interface to it
without changing the core behavior or license of the original software. The use
of PyHPS requires a legally licensed local copy of Ansys HPC Platform Services.To get a copy of Ansys HPC Platform Services, see theAnsys HPC Platform Services Guidein the Ansys Help.
|
ansys-magnet-segmentation-toolkit
|
The Magnet Segmentation Toolkit is a Python wrapper for automating the segmentation
and skew of interior permanent magnet (IPM) and surface permanent magnet (SPM)
motors using Ansys Electronics Desktop (AEDT). You can launch this toolkit
from the AEDT UI or launch it directly from a Python console.RequirementsIn addition to the runtime dependencies listed inGetting started,
the Magnet Segmentation Toolkit requires AEDT 2023 R1 or later. This toolkit also supports the AEDT
Student Version for 2023 R1 or later.Documentation and issuesDocumentation for the latest stable release of the Magnet Segmentation Toolkit is hosted atMagnet Segmentation Toolkit documentation.In the upper right corner of the documentation’s title bar, there is an option for switching from
viewing the documentation for the latest stable release to viewing the documentation for the
development version or previously released versions.On theMagnet Segmentation Toolkit Issuespage, you can create issues to report bugs and request new features. On theDiscussionspage on the Ansys Developer portal, you can post questions, share ideas, and get community feedback.LicenseThe Magnet Segmentation Toolkit is licensed under the MIT license.This toolkit makes no commercial claim over Ansys whatsoever. The use of this toolkit
requires a legally licensed copy of AEDT. For more information, see theAnsys Electronicspage on the Ansys website.
|
ansys-mapdl-core
|
OverviewThe PyMAPDL project supports Pythonic access to MAPDL to be able to
communicate with the MAPDL process directly from Python. The latestansys-mapdl-corepackage
enables a more comprehensive interface with MAPDL and supports:All the features of the original module (for example, Pythonic commands
and 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 Visual Studio Code:PyMAPDL works within Jupyter Notebooks, the standard Python console,
or in batch mode on Windows, Linux, and even Mac OS.Documentation and issuesDocumentation for the latest stable release of PyMAPDL is hosted atPyMAPDL Documentation.In the upper right corner of the documentation's title bar, there is an option for switching from
viewing the documentation for the latest stable release to viewing the documentation for the
development version or previously released versions.You can alsoviewordownloadthe
PyMAPDL cheat sheet. This one-page reference provides syntax rules and commands
for using PyMAPDL.For troubleshooting, visitTroubleshooting PyMAPDLOn thePyMAPDL Issuespage,
you can create issues to report bugs and request new features. On thePyMAPDL Discussionspage
or theDiscussionspage on theAnsys Developer portal,
you can post questions, share ideas, and get community feedback.To reach the project support team, emailPyAnsys Core team.
Unfortunately, this team cannot answer specific library questions or issues. You must
use thePyMAPDL IssuesandPyMAPDL Discussionspages
for raising issues, request new features, and asking questions.You can contribute to PyMAPDL by developing new features, fixing bugs, improving the documentation,
fixing typos, writing examples, etc.
To learn how to contribute to PyMAPDL, visitContributing section.Project transition - legacy supportThis project was formerly known aspyansys, and we'd like to thank
all the early adopters, contributors, and users who submitted issues,
gave feedback, and contributed code through the years. Thepyansysproject has been taken up at Ansys and is being leveraged in
creating new Pythonic, cross-platform, and multi-language service-based
interfaces for Ansys's products. Your contributions topyansyshas shaped it into a better solution.Thepyansysproject is expanding beyond just MAPDL, and while
there are many new features and changes to the original Python module,
many steps have been taken to ensure compatibility with legacy code
while supporting new features. The original Python module has been
split up into the following projects and modules:ansys.mapdl.coreansys.mapdl.readeransys.mapdl.corbaFor more information on each project, visit their GitHub pages.Citing this moduleIf you usePyMAPDLfor
research and would like to cite the module and source, you can visitpyansys Zenodoand generate the
correct citation. For example, the BibTex citation is:@software{alexander_kaszynski_2020_4009467,author={Alexander Kaszynski},title={{pyansys: Python Interface to MAPDL and AssociatedBinary and ASCII Files}},month=aug,year=2020,publisher={Zenodo},version={0.43.2},doi={10.5281/zenodo.4009467},url={https://doi.org/10.5281/zenodo.4009467}}Because the citation here might not be current, visit the link above to obtain
the most recent citation.License and acknowledgmentsPyMAPDLis licensed underthe MIT license.ansys-mapdl-corepackage
makes no commercial claim over Ansys whatsoever.This tool extends the functionality ofMAPDLby adding a Python
interface to the MAPDL service without changing the
core behavior or license of the original software. The use of the
interactive APDL control ofPyMAPDLrequires a legally licensed local copy of Ansys.To get a copy of Ansys, visitAnsys.
|
ansys-mapdl-reader
|
This is the legacy module for reading in binary and ASCII files
generated from MAPDL.This Python module allows you to extract data directly from binary
ANSYS v14.5+ files and to display or animate them rapidly using a
straightforward API coupled with C libraries based on header files
provided by ANSYS.Theansys-mapdl-readermodule supports the following formats:*.rst- Structural analysis result file*.rth- Thermal analysis result file*.emat- Element matrix data file*.full- Full stiffness-mass matrix file*.cdbor*.dat- MAPDL ASCII block archive and
Mechanical Workbench input filesPlease see thePyMAPDL-Reader Documentationfor the full documentation.NoteThis module may be depreciated in the future.You are encouraged to use the new Data Processing Framework (DPF)
modules atPyDPF-CoreandPyDPF-Postas they provide a
modern interface to Ansys result files using a client/server
interface using the same software used within Ansys Mechanical, but
via a Python client.NoteResult file compatibility will be greatly improved by disabling result file
compression by setting/FCOMP,RST,0.DPF does not have this restriction.InstallationInstallation through pip:pip install ansys-mapdl-readerYou can also visitpymapdl-readerto download the source or releases from GitHub.ExamplesLoading and Plotting a MAPDL Archive FileANSYS archive files containing solid elements (both legacy and
modern), can be loaded using Archive and then converted to a vtk
object.fromansys.mapdlimportreaderaspymapdl_readerfromansys.mapdl.readerimportexamples# Sample *.cdbfilename=examples.hexarchivefile# Read ansys archive filearchive=pymapdl_reader.Archive(filename)# Print raw data from cdbforkeyinarchive.raw:print("%s:%s"%(key,archive.raw[key]))# Create a vtk unstructured grid from the raw data and plot itgrid=archive.parse_vtk(force_linear=True)grid.plot(color='w',show_edges=True)# write this as a vtk xml filegrid.save('hex.vtu')# or as a vtk binarygrid.save('hex.vtk')You can then load this vtk file usingpyvistaor another program that uses VTK.# Load this from vtkimportpyvistaaspvgrid=pv.UnstructuredGrid('hex.vtu')grid.plot()Loading the Result FileThis example reads in binary results from a modal analysis of a beam
from ANSYS.# Load the reader from pyansysfromansys.mapdlimportreaderaspymapdl_readerfromansys.mapdl.readerimportexamples# Sample result filerstfile=examples.rstfile# Create result object by loading the result fileresult=pymapdl_reader.read_binary(rstfile)# Beam natural frequenciesfreqs=result.time_values>>>print(freq)[7366.495039697366.4950396911504.8952366417285.7045945617285.7045945720137.19299035]Get the 1st bending mode shape. Results are ordered based on the
sorted node numbering. Note that results are zero indexed>>>nnum,disp=result.nodal_solution(0)>>>print(disp)[[2.89623914e+01-2.82480489e+01-3.09226692e-01][2.89489249e+01-2.82342416e+012.47536161e+01][2.89177130e+01-2.82745126e+016.05151053e+00][2.88715048e+01-2.82764960e+011.22913304e+01][2.89221536e+01-2.82479511e+011.84965333e+01][2.89623914e+01-2.82480489e+013.09226692e-01]...Plotting Nodal ResultsAs the geometry of the model is contained within the result file, you
can plot the result without having to load any additional geometry.
Below, displacement for the first mode of the modal analysis beam is
plotted usingVTK.# Plot the displacement of Mode 0 in the x directionresult.plot_nodal_solution(0,'x',label='Displacement')Results can be plotted non-interactively and screenshots saved by
setting up the camera and saving the result. This can help with the
visualization and post-processing of a batch result.First, get the camera position from an interactive plot:>>>cpos=result.plot_nodal_solution(0)>>>print(cpos)[(5.2722879880979345,4.308737919176047,10.467694436036483),(0.5,0.5,2.5),(-0.2565529433509593,0.9227952809887077,-0.28745339908049733)]Then generate the plot:result.plot_nodal_solution(0,'x',label='Displacement',cpos=cpos,screenshot='hexbeam_disp.png',window_size=[800,600],interactive=False)Stress can be plotted as well using the below code. The nodal stress
is computed in the same manner that ANSYS uses by to determine the
stress at each node by averaging the stress evaluated at that node for
all attached elements. For now, only component stresses can be
displayed.# Display node averaged stress in x direction for result 6result.plot_nodal_stress(5,'Sx')Nodal stress can also be generated non-interactively with:result.plot_nodal_stress(5,'Sx',cpos=cpos,screenshot=beam_stress.png,window_size=[800,600],interactive=False)Animating a Modal SolutionMode shapes from a modal analysis can be animated usinganimate_nodal_solution:result.animate_nodal_solution(0)If you wish to save the animation to a file, specify the
movie_filename and animate it with:result.animate_nodal_solution(0,movie_filename='/tmp/movie.mp4',cpos=cpos)Reading a Full FileThis example reads in the mass and stiffness matrices associated with
the above example.# Load the reader from pyansysfromansys.mapdlimportreaderaspymapdl_readerfromscipyimportsparse# load the full filefobj=pymapdl_reader.FullReader('file.full')dofref,k,m=fobj.load_km()# returns upper triangle only# make k, m full, symmetric matricesk+=sparse.triu(k,1).Tm+=sparse.triu(m,1).TIf you havescipyinstalled, you can solve the eigensystem for its
natural frequencies and mode shapes.fromscipy.sparseimportlinalg# condition the k matrix# to avoid getting the "Factor is exactly singular" errork+=sparse.diags(np.random.random(k.shape[0])/1E20,shape=k.shape)# Solvew,v=linalg.eigsh(k,k=20,M=m,sigma=10000)# System natural frequenciesf=np.real(w)**0.5/(2*np.pi)print('First four natural frequencies')foriinrange(4):print'{:.3f}Hz'.format(f[i])First four natural frequencies
1283.200 Hz
1283.200 Hz
5781.975 Hz
6919.399 HzDeveloping on WindowsThis package is designed to be developed on Linux, and if you need to develop on Windows
you will need to install your own C++ compiler. We recommend:Install Visual C++Seeherefor a list of which Python versions correspond to which Visual C++ versionInstall the development version of pymapdl-reader to your Python environmentNavigate to the project’s top level (the same directory as this README)runpip install-e.License and AcknowledgmentsTheansys-mapdl-readerlibrary is licensed under the MIT license.
|
ansys-materials-manager
|
PyMaterials Manager is a Python package for unifying material management across the Ansys portfolio.InstallationTwo installation modes are provided: user and developer.Install in user modeBefore installing theansys-materials-managerpackage, run this command to
ensure that you have the latest version ofpip:python-mpipinstall-UpipThen, install the latest package for use with this command:poetryrunpython-mpipinstallansys-materials-managerInstall in development modeInstalling theansys-materials-managerpackage in developer mode allows
you to modify the source and enhance it.Before contributing to PyMaterials Manager, see thePyAnsys Developer’s Guide.To install PyMaterials Manager in developer mode, perform these steps:Cloning the repository:gitclonehttps://github.com/pyansys/pymaterials-managerCreate a fresh-clean Python environment and activate it:# Create a virtual environmentpython-mvenv.venv# Activate it in a POSIX systemsource.venv/bin/activate# Activate it in Windows CMD environment.venv\Scripts\activate.bat# Activate it in Windows Powershell.venv\Scripts\Activate.ps1Make sure that you have the latest required build system and doc, testing,
and CI tools:python-mpipinstall-Upippoetrytoxpython-mpipinstall-rrequirements/requirements_build.txtpython-mpipinstall-rrequirements/requirements_doc.txtpython-mpipinstall-rrequirements/requirements_tests.txtInstall the project in editable mode:poetryrunpython-mpipinstallansys-materials-managerVerify your development installation:toxTestingThis project takes advantage oftox. This tool is used to automate common
development tasks (similar to Makefile), but it is oriented towards Python
development.Usetoxtoxuses environments, which are similar toMakefilerules, to make it highly
customizable. In fact, this tool creates its own virtual environment so that anything
being tested is isolated from the project to guarantee the project’s integrity.Descriptions follow of some of the most widely used environments:tox -e style: Checks the code style of your project.tox -e py: Runs your test suite.tox -e py-coverage: Checks unit tests and code coverage.tox -e doc: Builds the documentation of your project.Perform raw testingIf required, you can call style commands (such asblack,isort,
andflake8) or unit testing commands (such aspytest) from the command
line. However, calling these commands does not guarantee that your project
is being tested in an isolated environment, which is the reason why tools
liketoxexist.Use pre-commitThe style checks take advantage ofpre-commit. Developers are not forced but
encouraged to install this tool by running this command:python-mpipinstallpre-commit&&pre-commitinstallEvery time you stage some changes and try to commit them,pre-commitonly allows them to be committed if all defined hooks succeed.Documentation and issuesFor comprehensive information on PyMaterials Manager, see the latest releasedocumentation.
On thePyMaterials Manager Issuespage, you can create issues to submit questions,
report bugs, and request new features. This is the best place to post questions and code.DistributionIf you want to create either source or wheel files, start by installing
the building requirements and then executing the build module:python-mpipinstall-rrequirements/requirements_build.txtpython-mbuildpython-mtwinecheckdist/*
|
ansys-math-core
|
PyAnsys Math is a Python repository holding Ansys mathematical libraries.
To use them, you must have a local installation of Ansys Mechanical APDL.For information on getting a licensed copy of Ansys Mechanical APDL, visit
theAnsys web site.InstallationFor usersTheansys.math.corepackage currently supports Python 3.8 through
Python 3.11 on Windows, Mac OS, and Linux.Install the latest package for use with this command:pip install ansys-math-coreAlternatively, install the latestPyAnsys Math GitHubpackage
with this command:pip install git+https://github.com/ansys/pyansys-math.gitFor developersFor a localdevelopmentversion, install the latest package with:git clone https://github.com/ansys/pyansys-math.git
cd pyansys-math
pip install -e .Installing the development version allows you to edit theansys-math-corepackage locally. The changes that you make are reflected in your setup
after restarting the Python kernel.Verify your installationCheck that you can start PyAnsys Math from Python by running this code:importansys.math.core.mathaspymath# Start PyAnsys Math.mm=pymath.AnsMath()print(mm)If you see a response from the server, you can start using PyAnsys Math
as a service.Ansys software requirementsYou must have a copy of Ansys 2021 R1 or later installed locally.NoteThe latest versions of Ansys provide significantly better support
and features. PyAnsys Math is not supported on Ansys versions earlier than 2021 R1.
|
ansys-mechanical-core
|
OverviewPyMechanical brings Ansys Mechanical to Python. It enables your Python programs to use
Mechanical within Python’s ecosystem. It includes the ability to:Connect to a remote Mechanical sessionEmbed an instance of Mechanical directly as a Python objectInstall the packageInstall PyMechanical usingpipwith:pip install ansys-mechanical-coreFor more information, seeInstall the packagein the PyMechanical documentation.DependenciesYou must have a licensed copy ofAnsys Mechanicalinstalled. When using an embedded instance, that installation must be runnable from the
same computer as your Python program. When using a remote session, a connection to that
session must be reachable from your Python program.Getting startedPyMechanical uses the built-in scripting capabilities of Mechanical. For information on the
scripting APIs available, see theScripting in Mechanical Guidein the
Ansys Help.Configuring the mechanical installationOn a Windows system, the environment variableAWP_ROOT<ver>is configured when Mechanical is
installed, where<ver>is the Mechanical release number, such as231for release 2023 R1.
PyMechanical automatically uses this environment variable (or variables if there are multiple
installations of different versions) to locate the latest Mechanical installation. On a Linux
system, you must configure theAWP_ROOT<ver>environment variable to point to the
absolute path of a Mechanical installation.Starting a remote sessionTo start a remote session of Mechanical on your computer from Python, use thelaunch_mechanical()method. This methods returns an object representing the connection to the session:importansys.mechanical.coreaspymechanicalmechanical=pymechanical.launch_mechanical()Running commands on the remote sessionGiven a connection to a remote session, you can send an IronPython script. This uses the built-in
scripting capabilities of Mechanical. Here is an example:result=mechanical.run_python_script("2+3")result=mechanical.run_python_script("ExtAPI.DataModel.Project.ProjectDirectory")Using an embedded instance of Mechanical as a Python objectPyMechanical also supports directly embedding an instance of Mechanical as a Python object.
In this mode, there is no externally running instance of Mechanical. This feature is supported
on Windows for version 2023 R1 and later, and on Linux for version 2023 R2
and later. Here is an example:importansys.mechanical.coreaspymechanicalapp=pymechanical.App()project_dir=app.ExtAPI.DataModel.Project.ProjectDirectoryDocumentation and issuesDocumentation for the latest stable release of PyMechanical is hosted atPyMechanical documentation.In the upper right corner of the documentation’s title bar, there is an option for switching from
viewing the documentation for the latest stable release to viewing the documentation for the
development version or previously released versions.You can alsoviewordownloadthe
PyMechanical cheat sheet. This one-page reference provides syntax rules and commands
for using PyMechanical.On thePyMechanical Issuespage,
you can create issues to report bugs and request new features. On thePyMechanical Discussionspage or theDiscussionspage on the Ansys Developer portal, you can post questions, share ideas, and get community feedback.To reach the project support team, [email protected] and developmentIf you would like to test or contribute to the development of PyMechanical, seeContributein
the PyMechanical documentation.
|
ansys-mechanical-env
|
OverviewPyMechanical-Env contains a package,ansys-mechanical-env, that facilitates the integration
of PyMechanical within a Linux environment. The package has the ability to:Automatically determine the version and location of the Ansys Mechanical software.Offer users the option to manually specify the version number for Mechanical.Configure and set the requisite environment variables.InstallationTwo installation modes are provided: user and developer.Install in user modeBefore installing theansys-mechanical-envpackage, make sure that you
have the latest version ofpipwith this command:python-mpipinstall-UpipThen, install theansys-mechanical-envpackage with this command:python-mpipinstallansys-mechanical-envInstall in developer modeInstalling theansys-mechanical-envpackage in developer mode allows you to modify the
source and enhance it.Before contributing to the project, ensure that you are thoroughly familiar with thePyAnsys Developer’s Guide.To install theansys-mechanical-envpackage in developer mode, perform these steps:Clone the PyMechanical-Env repository with this command:gitclonehttps://github.com/ansys/pymechanical-envCreate a clean Python environment and activate it with these commands:# Create a virtual environmentpython-mvenv.venv# Activate it in a POSIX systemsource.venv/bin/activate# Activate it in Windows CMD environment.venv\Scripts\activate.bat# Activate it in Windows Powershell.venv\Scripts\Activate.ps1Make sure you have the latest required build system and documentation, testing, and CI tools
with these commands:python-mpipinstall-Upipsetuptoolstoxpython-mpipinstall-rrequirements/requirements_build.txtpython-mpipinstall-rrequirements/requirements_tests.txtInstall the project in editable mode with this command:python-mpipinstall--editableansys-mechanical-envVerify your development installation by running this command:toxBasic usageOnce theansys-mechanical-envandansys-mechanical-corepackages are installed,
you can run the PyMechanical-Env command-line tool to launch and test embedded instances
of PyMechanical on Linux.Launching a Python shell containing environment variables set up by PyMechanical-Env
allows you to run embedded instances of PyMechanical on Linux.Launch the Python shell with this command:mechanical-envpythonIn the Python shell, use this code to run an embedded instance of PyMechanical:importansys.mechanical.coreaspymechanicalapp=pymechanical.App()print(app)Run all embedding tests in the PyMechanical repository with this command:xvfb-runmechanical-envpytest-membeddingHow to testThis project takes advantage oftox. This tool allows you to automate common
development tasks (similar to Makefile), but it is oriented towards Python
development.UsingtoxAs Makefile has rules,toxhas environments. In fact,toxcreates its
own virtual environment so anything being tested is isolated from the project to
guarantee the project’s integrity. These environment commands are provided:tox -e style: Checks for coding style quality.tox -e py: Checks for unit tests.tox -e py-coverage: Checks for unit testing and code coverage.Raw testingIf required, you can always call the style commands (black,isort,flake8…) or unit testing ones (pytest) from the command line. However,
this does not guarantee that your project is being tested in an isolated
environment, which is the reason why tools liketoxexist.A note on pre-commitThe style checks take advantage ofpre-commit. Developers are not forced but
encouraged to install this tool with this command:python-mpipinstallpre-commit&&pre-commitinstallDistributingIf you would like to create either source or wheel files, start by installing
the building requirements and then execute the build module:python-mpipinstall-rrequirements/requirements_build.txtpython-mbuildpython-mtwinecheckdist/*Documentation and issuesDocumentation for the latest stable release of this package can be found in this
README file.On thePyMechanical-Env Issues page,
you can create issues to report bugs and request new features. On thePyMechanical-Env Discussionspage or theDiscussions pageon the Ansys Developer portal, you
can post questions, share ideas, and get community feedback.To reach the project support team, [email protected] and acknowledgmentsPyMechanical-Env is licensed under theMIT license.For more information, see the.reuse/dep5 filefile, which follows theReuse specification.PyMechanical-Env makes no commercial claim over Ansys whatsoever. This tool supportsPyMechanical, which extends the functionality
of Ansys Mechanical by adding a Python interface to the Mechanical service without changing
the core behavior or license of the original software. The use of PyMechanical with an embedded
or remote instance of the Mechanical application requires a legally licensed local copy of Ansys.For more information on the Mechanical application, see theAnsys Mechanicalpage on the Ansys website.
|
ansys-meshing-prime
|
PyPrimeMeshOverviewPyPrimeMesh is a Python client to Ansys Prime Server, which
delivers core Ansys meshing technology.Documentation and issuesDocumentation for the latest stable release of PyPrimeMesh is hosted atPyPrimeMesh documentation.In the upper right corner of the documentation's title bar, there is an option
for switching from viewing the documentation for the latest stable release
to viewing the documentation for the development version or previously
released versions.You can alsoviewordownloadthe
PyPrimeMesh cheat sheet. This one-page reference provides syntax rules and commands
for using PyPrimeMesh.On thePyPrimeMesh Issuespage,
you can create issues to report bugs and request new features. On thePyPrimeMesh Discussionspage or theDiscussionspage on the Ansys Developer portal,
you can post questions, share ideas, and get community feedback.To reach the project support team, emailpyansys.core@ansys.com.InstallationTheansys-meshing-primepackage supports Python 3.8 to Python 3.11 on the Windows and Linux
operating systems.PyPrimeMesh can be installed with all dependencies directly from PyPi by running
this command:pipinstallansys-meshing-prime[all]Alternatively, you can clone this repository and install the client using
these commands:gitclonehttps://github.com/ansys/pyprimemeshcdpyprimemesh
pipinstall-e.[all]The preceding commands install all functionality that is important to development.
To install a basic version of the client, use this command instead:pipinstall-e.DependenciesYou must have Ansys 2023 R1 or later installed for access to Ansys Prime Server.
Optionally, CAD readers can be configured. Ansys Prime Server requires
an Ansys Mechanical PrepPost or Fluids PrepPost (CFD) license to run.Get startedLaunch PyPrimeMeshTo launch PyPrimeMesh, use this code:importansys.meshing.primeasprimewithprime.launch_prime()asprime_client:model=prime_client.modelLicense and aknowledgmentsPyPrimeMesh is licensed under the MIT license.PyPrimeMesh makes no commercial claim over Ansys whatsoever. This library extends the functionality of
Ansys Prime Server by adding a Python interface without changing the core behavior or license
of the original software. The use of Ansys Prime Server requires a legally licensed copy of Ansys
2023 R1 or later.
|
ansys-motorcad-core
|
OverviewAnsys Motor-CAD is a dedicated design and analysis tool for electric motors. It enables rapid
and accurate multiphysics design and analysis of electric machines across the full-operating
spectrum.PyMotorCAD uses a Python JSON-RPC (remote procedure call) interface for
Motor-CAD to launch or connect with a Motor-CAD instance, either locally or
from a remote machine via HTTP. With PyMotorCAD, you can programmatically
create, interact with, and control a Motor-CAD model, with or without using
the Motor-CAD GUI.Documentation and issuesDocumentation for the latest stable release of PyMotorCAD is hosted atPyMotorCAD documentation.In the upper right corner of the documentation’s title bar, there is an option for switching from
viewing the documentation for the latest stable release to viewing the documentation for the
development version or previously released versions.You can alsoviewordownloadthe
PyMotorCAD cheat sheet. This one-page reference provides syntax rules and commands
for using PyMotorCAD.On thePyMotorCAD Issuespage, you can create
issues to report bugs and request new features. On theDiscussionspage on the Ansys Developer portal, you can post questions, share ideas, and get community feedback.To reach the project support team, [email protected] has two installation modes: user and developer.Install in user modeBefore installing PyMotorCAD in user mode, run this command to ensure
that you have the latest version ofpip:python-mpipinstall-UpipThen, run this command to install PyMotorCAD:python-mpipinstallansys-motorcad-coreInstall in developer modeInstalling PyMotorCAD in developer mode allows
you to modify the source and enhance it.Note:Before contributing to this project, ensure that you are familiar
with all guidelines in thePyAnsys Developer’s Guide.To install in developer mode, complete these steps:Clone thepymotorcadrepository with this command:gitclonehttps://github.com/ansys/pymotorcadCreate a fresh-clean Python environment and then activate it with these
commands:# Create a virtual environmentpython-mvenv.venv# Activate it in a POSIX systemsource.venv/bin/activate# Activate it in Windows CMD environment.venv\Scripts\activate.bat# Activate it in Windows Powershell.venv\Scripts\Activate.ps1Ensure that you have the latest required build system and
documentation, testing, and CI tools with this command:python-mpipinstall-UpiptoxInstall the project in editable mode with this command:python-mpipinstall--editableansys-motorcad-coreVerify your development installation with this command:toxTestingThis project takes advantage oftox. This tool allows you to automate common
development tasks (similar to Makefile), but it is oriented towards Python
development.While Makefile has rules,toxhas environments. In fact,toxcreates
its own virtual environment to guarantee the project’s integrity by isolating
anything being tested.toxcommandsHere are commands for running various checks in thetoxenvironment:tox -e style: Checks for coding style quality.tox -e py: Checks for unit tests.tox -e py-coverage: Checks for unit testing and code coverage.tox -e doc: Checks for the documentation-building process.Raw testingIf required, you can call style commands, such asblack,isort,
andflake8, or unit testing commands, such as`pytest`_, from the command line.
However, using these commands does not guarantee that your project is being
tested in an isolated environment, which is why tools liketoxexist.Style checksThe style checks take advantage ofpre-commit. Developers are not forced but
encouraged to install this tool by running this command:python-mpipinstallpre-commit&&pre-commitinstallDocumentation buildsTo build documentation, you can run the usual rules provided in theSphinxMakefile with a command like this:make-Cdoc/html&&your_browser_namedoc/html/index.htmlHowever, the recommended way of checking documentation integrity is to use
atoxcommand like this:tox-edoc&&your_browser_name.tox/doc_out/index.htmlDistributionIf you would like to create either source or wheel files, run the following
commands to install the building requirements and execute the build module:python-mpipinstall-Upippython-mbuildpython-mtwinecheckdist/*License and acknowledgementsPyMotorCAD is licensed under the MIT license. For more information, see theLICENSEfile.PyMotorCAD makes no commercial claim over Ansys whatsoever. This library
extends the capability of Ansys Motor-CAD by adding a Python interface
to Motor-CAD without changing the core behaviour or license of the original
software. Using PyMotorCAD for interactive control of Motor-CAD requires
a legally licensed copy of Motor-CAD.For more information on Motor-CAD, see theAnsys Motor-CADpage on the Ansys website.
|
ansys-openapi-common
|
OverviewOpenAPI-Common is intended for use with the custom code generation
template in thePyAnsys project.
It provides the source code for an authentication-aware
client for OpenAPI client libraries.OpenAPI-Common supports authentication with Basic, Negotiate, NTLM,
and OpenID Connect. Most features of the underlying requests session
are exposed for use. Some basic configuration is also provided by default.InstallationInstall theopenapi-commonrepository with this code:pip install ansys-openapi-commonAlternatively, clone and install the repository with this code:git clone https://github.com/pyansys/openapi-common
cd openapi-common
pip install .UsageThe API client class is intended to be wrapped by code that implements a client library.
You should override the__init__()orconnect()method to add any
additional behavior that might be required.Authentication is configured through theApiClientFactoryobject and itswith_xxx()methods. If no authentication is required, you can use thewith_anonymous()method.
You can provide additional configuration with theSessionConfigurationobject.>>>fromansys.openapi.commonimportApiClientFactory>>>session=ApiClientFactory('https://my-api.com/v1.svc')....with_autologon()....connect()<ApiClienturl:https://my-api.com/v1.svc>Authentication schemesOpenAPI-Common supports API servers configured with no authentication, API keys,
client certificates, and basic authentication schemes.Windows users can also use Windows Integrated Authentication to connect to Kerberos-enabled
APIs with their Windows credentials and to NTLM where it is supported.Linux users can make use of Kerberos authentication via the[linux-kerberos]extra. This
requires a working installation of either MIT Kerberos or Heimdal, as well as some
platform-specific build steps. An additional requirement is a correctly configuredkrb5.keytabfile on your system.Windows and Linux users can authenticate with OIDC-enabled APIs by using the[oidc]extra.
Currently only the Authorization Code authentication flow is supported.Authentication methods by platformAuthentication methodWindowsLinuxBuilder methodAdditional settingsAPI Key✔️✔️.with_anonymous()Set the appropriate header inapi_session_configurationClient Certificate✔️✔️AnyProvideclient_cert_pathand optionallyclient_cert_keyinapi_session_configurationBasic✔️✔️.with_credentials()NTLM✔️❌.with_credentials()Kerberos✔️➕ with[linux-kerberos]extra.with_autologon()OIDC➕ with[oidc]extra➕ with[oidc]extra.with_oidc()Platform-specific Kerberos configurationKerberos authentication should be supported wherever the MIT or Heimdal Kerberos client
can be installed. OpenAPI-Common has been tested on the platforms that follow.
If you manage to use it on another platform, consider contributing installation steps for
your platform by making a pull request.Ubuntu 20.04Ubuntu requires thegssapiPython module to be built from source. This requires the
Kerberos headers, Python headers for the version of Python that you are using (here we have
installed python3.10 from the deadsnakes ppa), and a supported compiler. (GCC works well.))You should then be able to install this module with the[linux-kerberos]extra.sudoaptinstallbuild-essentialpython3.10-devlibkrb5-devpipinstallansys-openapi-common[linux-kerberos]Once the installation completes, ensure that yourkrb5.conffile is set up correctly
for your Kerberos configuration and that you have a validkeytabfile, which is
normally in/etc/krb5.keytab.LicenseOpenAPI-Common is provided under the terms of the MIT license. You can find
the license text in the LICENSE file at the root of the repository.
|
ansys-optislang-core
|
OverviewPyOptiSLang is a Python wrapper for Ansys optiSLang. It supports Pythonic
access to Ansys optiSLang to be able to communicate with Ansys optiSLang directly from Python.
The latestansys-optislangpackage provides these capabilities:Starting and managing local instances of Ansys optiSLangRemote connections to Ansys optiSLang instances via TCP/IPCreate new Ansys optiSLang projectOpen existing Ansys optiSLang projectControl Ansys optiSLang project executionSave Ansys optiSLang projectExecute classic Ansys optiSLang Python API script on backend sideEvaluate designs on root project levelDocumentation and issuesFor comprehensive information on PyOptiSLang, see the latest releasedocumentation. On thePyOptiSLang Issuespage,
you can create issues to submit questions, report bugs, and request new features.
This is the best place to post questions and code.InstallationTheansys-optislang-corepackage supports Python 3.7 through 3.11 on
Windows and Linux. Three modes of installation are available:User installationDeveloper installationOffline installationFor either a developer or offline installation, consider using avirtual environment.User installationInstall the latest release fromPyPiwith this command:pip install ansys-optislang-coreAlternatively, install the latestPyOptiSLang GitHubpackage with this command:pip install git+https://github.com/ansys/pyoptislang.gitDeveloper installationIf you plan on doing localdevelopmentwith GitHub, clone and
install PyOptiSLang with this code:git clone https://github.com/ansys/pyoptislang.git
cd pyoptislang
pip install -e .A developer installation allows you to editansys-optislang-corefiles locally. Any changes that you make are reflected in your setup
after restarting the Python kernel.Offline installationUsing a wheelhouse can be helpful if you work for a company that restricts access to
external networks. From theReleasespage in the PyOptiSLang repository, you can find the wheelhouses for a particular release in its
assets and download the wheelhouse corresponding to your setup.You can then install PyOptiSLang and all of its dependencies from one single entry point
that can be shared internally, which eases the security review of the PyOptiSLang package content.For example, on Linux with Python 3.7, unzip the wheelhouse and install PyOptiSLang with code
like this:unzipPyOptiSLang-v0.1.0-wheelhouse-Linux-3.7.zipwheelhousepipinstallansys-optislang-core-fwheelhouse--no-index--upgrade--ignore-installedIf you’re on Windows with Python 3.9, unzip the wheelhouse to a wheelhouse directory and
then install using the samepipcommand as in the preceding Linux code example.DependenciesYou must have a local licensed copy or a remote instance of optiSLang installed. The first
supported version is 2023 R1.Getting startedUsing theOptislangclass, you can either launch optiSLang locally or connect to a
remote optiSLang instance.Launch optiSLang locallyFor launching optiSLang locally, both thehostandportparameters in theOptislangclass must be set toNone, which are their defaults. Other parameters can optionally
be specified.fromansys.optislang.coreimportOptislangosl=Optislang()osl.dispose()Connect to a remote optiSLang instanceFor remote connection, it is assumed that an optiSLang instance is already running on
a remote (or local) host as a server. In this case, you must specify thehostandportparameters. Parameters related to the execution of a new optiSLang instance are ignored.fromansys.optislang.coreimportOptislanghost="127.0.0.1"port=5310osl=Optislang(host=host,port=port)osl.dispose()Basic usageThis code shows how to launch optiSLang locally, open and run a Python
script file, save the results to a new project, and then close the
connection:fromansys.optislang.coreimportOptislangosl=Optislang()file_path=r"C:\Users\Username\my_scripts\myscript.py"osl.application.project.run_python_file(path=file_path)osl.application.save_copy("MyNewProject.opf")osl.dispose()License and acknowledgmentsPyOptiSLang is licensed under the MIT license.PyOptiSLang makes no commercial claim over Ansys whatsoever. This library extends the
functionality of Ansys optiSLang by adding a Python interface to optiSLang without
changing the core behavior or license of the original software. The use of the interactive control
of PyOptiSLang requires a legally licensed local copy of optiSLang.For more information on optiSLang, see theAnsys optiSLangpage on the Ansys website.
|
ansys-platform-instancemanagement
|
PyPIMexposes a Pythonic interface to
communicate with the Product Instance Management (PIM) API.What is the PIM API?The PIM API is a gRPC API, enabling both library and app developers to
start a product in a remote environment and communicate with its API.The PIM API is intended to be as simple as possible to be adaptable in a variety of
network and software infrastructures. Using this API does not require any
knowledge of its infrastructure. You need only know which product to
start and which API the product exposes. The PIM API itself exposes very few
features and assumes that all the configuration is set on a server.The PIM API is not intended to manage stateless services, to be a job management
system, or a fully featured service orchestration API. Its purpose is to expose
a minimum feature set for managing service-oriented apps.Getting startedTo use PyPIM, you must have access to the PIM API.NoteThe PIM API is a work in progress. Even though the API definition and the
PyPIM client are published, the service itself is not publicly exposed.PyPIM itself is pure Python and relies ongRPC.InstallationTheansys-platform-instancemanagementpackage is tested for Python 3.7 through
Python 3.10 on Windows and Linux.pip install ansys-platform-instancemanagementConfigurationBy default, PyPIM is configured externally instead of via code. Anywhere in the
local storage, create a configuration file with this format:{"version":1,"pim":{"uri":"dns:pim.svc.com:80","headers":{"metadata-info":"value"},"tls":false}}Then, define the environment variableANSYS_PLATFORM_INSTANCEMANAGEMENT_CONFIGto point to this configuration file.UsagePyPIM is a single module calledansys.platform.instancemanagement, shortened
topypim.To start MAPDL and communicate with PyPIM, use this code:importansys.platform.instancemanagementaspypimfromansys.mapdl.coreimportMapdlifpypim.is_configured():withpypim.connect()aspim:withpim.create_instance(product_name="mapdl",product_version="221")asinstance:instance.wait_for_ready()channel=instance.build_grpc_channel(options=[("grpc.max_receive_message_length",8*1024**2)])mapdl=Mapdl(channel=channel)mapdl.prep7()...You can also use PyPIM without thewithstatement, as shown in this code:importansys.platform.instancemanagementaspypimfromansys.mapdl.coreimportMapdlifpypim.is_configured():pim=pypim.connect()instance=pim.create_instance(product_name="mapdl",product_version="221")channel=instance.build_grpc_channel(options=[("grpc.max_receive_message_length",8*1024**2)])mapdl=Mapdl(channel=channel)mapdl.prep7()...instance.delete()pim.close()IntegrationPyPIM can be integrated in PyAnsys libraries to transparently switch to a remote
instance in a suitable environment. This process is described inIntegrationin the PyPIM documentation.For example, starting MAPDL with PyPIM is as simple as using this code:fromansys.mapdl.coreimportlaunch_mapdlmapdl=launch_mapdl()
|
ansys-pre-commit-hooks
|
This Ansys repository containspre-commithooks for different purposes.
Currently, these hooks are available:add-license-headers: Add missing license headers to files by usingREUSE. To use this hook, you must
haveREUSEimplemented in your repository.add-license-headerssetupAdd required directoriesIf you are using the ansys.jinja2 template and MIT.txt license, skip this step. By default, the hook will make symbolic links
from its “assets” directory containing LICENSES/MIT.txt and .reuse/templates/ansys.jinja2
to your repository when the hook runs. The .reuse and LICENSES directories will be deleted once the hook is
done running.If you are using a custom template, create a directory named.reuse, and if you are using a custom license, create a directory
namedLICENSESin the root of your repository. The custom template cannot be namedansys.jinja2, otherwise it will be removed
after the hook is done running. The custom license cannot be namedMIT.txtfor the same reason. The.reuseand/orLICENSESdirectories will have to be committed to your repository and will not be removed once the hook is done running as long as there
are custom templates or licenses in those directories. Your project should have the following layout:project
├── LICENCES
│ └── license_name.txt
├── .reuse
│ └── templates
│ └── template_name.jinja2
├── src
├── examples
├── tests
├── .pre-commit-config.yaml
├── pyproject.tomlWherelicense_nameis the name of the license that is being used, for example, MIT.txt, andtemplate_nameis the name of the custom template being used. The jinja2 file contains the
template for the license headers that are added to the files.Licenses that are supported byREUSEcan be found in thespdx/license-list-datarepository.
Please select a license text file from that repository, and copy it to the LICENSES directory.Set custom arguments-repo:https://github.com/ansys/pre-commit-hooksrev:v0.2.9hooks:-id:add-license-headersargs:["--custom_copyright","customcopyrightphrase","--custom_template","template_name","--custom_license","license_name","--ignore_license_check","--start_year","2023"]argscan also be formatted as follows:args:---custom_copyright=custom copyright phrase---custom_template=template_name---custom_license=license_name---ignore_license_check---start_year=2023custom copyright phraseis the copyright line you want to include in the license
header. By default, it uses"ANSYS, Inc. and/or its affiliates.".template_nameis the name of the .jinja2 file located in.reuse/templates/.
By default, it usesansys.license_nameis the name of the license being used. For example, MIT, ECL-1.0, etc.
To view a list of licenses that are supported byREUSE, seehttps://github.com/spdx/license-list-data/tree/main/text. By default it usesMIT.ignore_license_checkis whether or not to check for the license in the header. By default,
it isFalse, meaning the files are checked for both the copyright and licensing information
in the header. Add--ignore_license_checkto ignore checking for licensing information
in the files.start_yearis the start year of the copyright statement. By default, thestart_yearis
the current year, making the copyright statement
“Copyright (C) 2024 ANSYS, Inc. and/or its affiliates.” If you are adding license headers
to packages released before the current year, add thestart_yearargument with the year your
package was released. For example, ifstart_yearis 2023, the copyright statement would be
“Copyright (C) 2023 - 2024 ANSYS, Inc. and/or its affiliates.” assuming the current year is 2024.Specify directories to run the hook onBy default, the hook will run on proto files in any directory, as well as python files within
directories namedsrc,examples, andtests. To specify additional files and/or directories
the hook should run on, add the necessary regex to thefilesline in your
.pre-commit-config.yaml file:-repo:https://github.com/ansys/pre-commit-hooksrev:v0.2.9hooks:-id:add-license-headersfiles:'(src|examples|tests|newFolder)/.*\.(py|newExtension)|\.(proto|newExtension)'Ignore specific files or file typesIn .pre-commit-config.yaml:-repo:https://github.com/ansys/pre-commit-hooksrev:v0.2.9hooks:-id:add-license-headersexclude:|(?x)^(path/to/file1.py |path/to/.*\.(ts|cpp) |(.folder1|folder2)/.* |.*\.js |\..* |)$path/to/file1.pyexcludes the stated file.path/to/.*\.(ts|cpp)excludes all .ts and .cpp files within thepath/todirectory.(.folder1|folder2)/.*excludes directories named .folder1 and folder2..*\.jsexcludes all .js files in all directories.\..*excludes all hidden files.How to installThe following sections provide instructions for installing theansys-pre-commit-hookspackage in two installation modes: user and developer.For usersBefore installing the package, to ensure that you
have the latest version ofpip, run this command:python-mpipinstall-UpipThen, to install the package, run this command:python-mpipinstallansys-pre-commit-hooksFor developersInstalling the package in developer mode allows you to modify and
enhance the source code.Before contributing to the project, ensure that you are familiar with
thePyAnsys Developer’s Guide.For a developer installation, you must follow these steps:Clone the repository with this command:gitclonehttps://github.com/ansys/pre-commit-hooksCreate a fresh-clean Python environment and activate it with these commands:# Create a virtual environmentpython-mvenv.venv# Activate it in a POSIX systemsource.venv/bin/activate# Activate it in Windows CMD environment.venv\Scripts\activate.bat# Activate it in Windows Powershell.venv\Scripts\Activate.ps1Ensure that you have the latest required build system tools by
running this command:python-mpipinstall-UpipflittoxtwineInstall the project in editable mode by running one of these commands:# Install the minimum requirementspython-mpipinstall-e.# Install the minimum + tests requirementspython-mpipinstall-e.[tests]# Install the minimum + doc requirementspython-mpipinstall-e.[doc]# Install all requirementspython-mpipinstall-e.[tests,doc]Verify your development installation by running this command:toxHow to test itThis project takes advantage oftox. This tool automates common
development tasks (similar to Makefile), but it is oriented towards
Python development.UsingtoxWhile Makefile has rules,toxhas environments. In fact,toxcreates its
own virtual environment so that anything being tested is isolated from the project
to guarantee the project’s integrity.These environment commands are provided:tox -e style: Checks for coding style quality.tox -e py: Checks for unit tests.tox -e py-coverage: Checks for unit testing and code coverage.tox -e doc: Checks for successfully building the documentation.Raw testingIf required, you can always call style commands, such asblack,isort,
andflake8, or unit testing commands, such aspytest, from the command line.
However, calling these commands does not guarantee that your project is
being tested in an isolated environment, which is the reason why tools liketoxexist.A note onpre-commitThe style checks take advantage ofpre-commit. Developers are not forced but
encouraged to install this tool by running this command:python-mpipinstallpre-commit&&pre-commitinstallDocumentationFor building documentation, you can run the usual rules provided in theSphinxMakefile with a command that is formatted like this:make-Cdoc/html&&your_browser_namedoc/html/index.htmlHowever, the recommended way of checking documentation integrity is by
runningtoxwith a command that is formatted like this:tox-edoc&&your_browser_name.tox/doc_out/index.htmlDistributingIf you would like to create either source or wheel files, install
the building requirements and then execute the build module with these commands:python-mpipinstall.python-mbuildpython-mtwinecheckdist/*
|
ansys-pyensight-core
|
OverviewPyEnSight is a Python wrapper forEnSight, the Ansys simulation postprocessor.
It supports Pythonic access to EnSight so that you communicate directly with it
from Python. With PyEnSight, you can perform these essential actions:Start a new EnSight session or connect to an existing one.Read simulation data from any supported solver output format into the session.Generate complex postprocessing results in a Pythonic fashion.Visualize the processed data, extract it, or get a widget to embed it in an external app.Documentation and IssuesDocumentation for the latest stable release of PyEnSight is hosted atPyEnSight documentation.In the upper right corner of the documentation’s title bar, there is an option for switching from
viewing the documentation for the latest stable release to viewing the documentation for the
development version or previously released versions.You can alsoviewordownloadthe
PyEnSight cheat sheet. This one-page reference provides syntax rules and commands
for using PyEnSight.On thePyEnSight Issuespage, you can
create issues to report bugs and request new features. On thePyEnSight Discussionspage or theDiscussionspage on the Ansys Developer portal,
you can post questions, share ideas, and get community feedback.To reach the project support team, [email protected] use PyEnSight, you must have a locally installed and licensed copy of
Ansys EnSight 2022 R2 or later. Theansys-pyensight-corepackage supports
Python 3.9 through Python 3.12 on Windows and Linux.Two modes of installation are available:User installationDeveloper installationUser installationInstall the latest release fromPyPIwith this command:pip install ansys-pyensight-coreDeveloper installationIf you plan on doing localdevelopmentof PyEnSight with GitHub, consider
using avirtual environment.To clone PyEnSight and then install it in a virtual environment, run these
commands:git clone https://github.com/ansys/pyensight
cd pyensight
pip install virtualenv
virtualenv venv # create virtual environment
source venv/bin/activate # (.\venv\Scripts\activate for Windows shell)
pip install .[dev] # install development dependenciesA developer installation allows you to editansys-pyensightfiles locally.
Any changes that you make are reflected in your setup after restarting the
Python kernel.To build and install PyEnSight, run these commands:python -m build # build
# this will replace the editable install done previously. If you don't want to replace,
# switch your virtual environments to test the new install separately.
pip install .[tests] # install test dependencies
pytest # Run the testsPre-commit setuppre-commitis a multi-language package manager for pre-commit hooks.To install pre-commit into your git hooks, run this command:pre-commit installpre-committhen runs on every commit. Each time you clone a project,
installingpre-commitshould always be the first action that you take.If you want to manually run all pre-commit hooks on a repository, run this
command:pre-commit run --all-filesA bunch of formatters run on your source files.To run individual hooks, use this command, where<hook_id>is obtained from
from the.pre-commit-config.yamlfile:pre-commit run <hook_id>The first time pre-commit runs on a file, it automatically downloads, installs,
and runs the hook.Local GitHub actionsSimulating GitHub Actions on your local desktop is recommended. After installing theactpackage, you can run a job. For
example, this command runs thedocsjob defined in theci_cd.ymlfile:act -j docsDeploy and upload stepsmust alwaysbe ignored. If they are not ignored, before
running a job, addif: ${{ !env.ACT }}to the workflow step (and commit if required).UsageYou can use this code to start the simplest PyEnSight session:>>>fromansys.pyensight.coreimportLocalLauncher>>>session=LocalLauncher().start()>>>data=session.render(1920,1080,aa=4)>>>withopen("image.png","wb")asf:...f.write(data)Optionally, EnSight can work with an EnSight Docker container using code like this:>>>fromansys.pyensight.coreimportDockerLauncher>>>launcher=DockerLauncher(data_directory="d:/data",use_dev=True)>>>launcher.pull()>>>session=launcher.start()>>>data=session.render(1920,1080,aa=4)>>>withopen("image.png","wb")asf:...f.write(data)In the preceding code, thedata_directoryargument specifies the host directory
to map into the container at the mount point, providing access to the data within
the container. This provides a method for EnSight running in the container to access
the host’s file system to read or write data. The optionaluse_dev=Trueargument
specifies that the latest development version of EnSight should be used.Also, PyEnSight can be launched as other PyAnsys products with thelaunch_ensightmethod:>>>fromansys.pyensight.coreimportlaunch_ensight>>>session=launch_ensight(use_sos=3)>>>data=session.render(1920,1080,aa=4)>>>withopen("image.png","wb")asf:...f.write(data)DependenciesYou will need a locally installed and licensed copy of Ansys to run EnSight, with the
first supported version being Ansys 2022 R2.Documentation and IssuesPlease see the latest releasedocumentationpage for more details.Please feel free to post issues and other questions atPyEnSight Issues. This is the best place
to post questions and code.LicensePyEnSight is licensed under the MIT license.PyEnsight makes no commercial claim over Ansys whatsoever. This library extends the functionality
of Ansys EnSight by adding a remote Python interface to EnSight without changing the core behavior
or license of the original software. The use of interactive control of PyEnSight requires a
legally licensed local copy of Ansys.For more information on EnSight, see theAnsys Ensightpage on the Ansys website.
|
ansys-pythonnet
|
Ansys fork ofpythonnet.We will try to keep this up-to-date with pythonnet and upstream changes that might benefit the pythonnet communityChanges relative to pythonnet:Revert of#1240.
|
ansys-report-engine
|
Failed to fetch description. HTTP Status Code: 404
|
ansys-report-sdk
|
Failed to fetch description. HTTP Status Code: 404
|
ansys-rocky-core
|
PyRocky is a Python client library for remotely controllingAnsys Rocky,
which is the most powerful software in the market for performing
DEM (discrete element method) simulations.Documentation and issuesDocumentation for the latest stable release of PyRocky is hosted atPyRocky documentation.The documentation has five sections:Getting started: Learn
how to install PyRocky in user mode and then launch it.User guide: Understand how to
use the Rocky PrePost API with PyRocky.API reference: Understand PyRocky API
endpoints, their capabilities, and how to interact with them programmatically.Examples: Explore end-to-end
examples that show how to use PyRocky.Contribute: Learn how to contribute
to the PyRocky codebase or documentation.In the upper right corner of the documentation’s title bar, there is an option
for switching from viewing the documentation for the latest stable release
to viewing the documentation for the development version or previously
released versions.On thePyRocky Issuespage, you can
create issues to report bugs and request new features. On theDiscussionspage on the Ansys Developer portal,
you can post questions, share ideas, and get community feedback.To reach the PyAnsys project support team, emailPyAnsys Core team.LicensePyRocky is licensed under theMIT License.PyRocky makes no commercial claim over Ansys whatsoever. This library extends the
functionality of Ansys Rocky by adding a Python interface without changing the
core behavior or license of the original software. The use of PyRocky requires a
legally licensed copy of Ansys Rocky.To get a copy of Ansys Rocky, see theAnsys Rockypage on the Ansys website.
|
ansys-scade-apitools
|
OverviewAnsys SCADE API Tools is an extension library for SCADE Python APIs.RequirementsTheansys-scade-apitoolspackage supports only the versions of Python delivered with
Ansys SCADE, starting from 2021 R2:2021 R2 through 2023 R1: Python 3.72023 R2 and later: Python 3.10Ansys SCADE API Tools has two installation modes: user and developer. To install for use,
seeGetting started.
To install for development, seeContribute.Documentation and issuesDocumentation for the latest stable release of Ansys SCADE API Tools is hosted atAnsys SCADE API Tools documentation.In the upper right corner of the documentation’s title bar, there is an option for
switching from viewing the documentation for the latest stable release to viewing the
documentation for the development version or previously released versions.On theAnsys Scade API Tools Issuespage, you can create issues to report bugs and request new features. On theDiscussionspage on the Ansys Developer portal, you can post questions, share ideas, and get community feedback.LicenseAnsys Scade API Tools is licensed under the MIT license.This toolkit makes no commercial claim over Ansys whatsoever. The use of this toolkit
requires a legally licensed copy of the Ansys SCADE Suite. For more information,
see theAnsys SCADE Suitepage on the Ansys website.
|
ansys-seascape
|
A pythonic remotable interface to RedHawkSC and TotemSC that allows integration with other PyAnsys and Python libraries.How to installInstall from PyPIUser installation can be performed by running:pipinstallansys-seascapeORpython-mpipinstallansys-seascapeInstall from latest Github sourceFetch latest source from github:cd<your-library-directory>gitclonehttps://github.com/pyansys/pyseascape.git(Optional) Create and enable virtual environment. Please refer to officialvenvdocumentation for more help regarding virtual environment setup.# Create a virtual environmentpython-mvenv.venv# Activate it in a POSIX systemsource.venv/bin/activate# Activate it in Windows CMD environment.venv\Scripts\activate.bat# Activate it in Windows Powershell.venv\Scripts\Activate.ps1Install the projectcdpyseascapepipinstall.Install additional requirements (if needed):python-mpipinstall.[tests]python-mpipinstall.[doc]UsageNote: Either a local installation or remote connection to licensed RedHawk-SC is required to use the pyseascape library. This only offers a remotable frontend interface that can run directly in native Python on any machine.Launching local RedHawk-SC in backendfromansys.seascapeimportRedHawkSCgp=RedHawkSC(executable=path_to_executable)ORfromansysimportseascapegp=seascape.RedHawkSC(executable=path_to_executable)Connecting to remote RedHawk-SC sessionfromansys.seascapeimportRedHawkSCgp=RedHawkSC(url=url_or_ip_to_redhawksc_server:port)All RedHawk-SC global functions can be called using prefix of RedHawkSC object name. Object methods can be called as normal.Running RedHawk-SC commandsFor example:# If gp = RedHawkSC(...)db=gp.open_db(db_name)# Returns a SeascapeDB remotable objectdb.create_design_view(...)# Creating RedHawk-SC objectsinst=gp.Instance('Inst_Name')# RedHawk-SC modules must also be prefixed by gp# E.g. using voltage_impact modulegp.voltage_impact.helpers.get_pgimpact_histograms(...)Accessing RedHawk-SC helpRedHawk-SC native help function supports command based as well as keyword based help.
This help can be accessed remotely as well.# If gp = RedHawkSC(...)# command based helpgp.help(command='gp.Scatter')# keyword based helpgp.help(keyword='scatter')Known issues and limitationsGUI features have not yet been implemented. Hence, commands like open_console_window, open_scheduler_window etc. do not work yet. Commands like gp.scatter_plot also does not work as it requires drawing gui plotsDocumentationPlease refer to RedHawk-SC Documentation.
|
ansys-sherlock
|
No description available on PyPI.
|
ansys-sherlock-core
|
PySherlock is a Python client library for the Ansys Sherlock product.OverviewAnsys Sherlock is a reliability physics-based electronics design tool that provides
fast and accurate life predictions for electronic hardware at the component,
board, and system levels in early stage design.PySherlock provides Pythonic access to Sherlock’s functions, enabling
users to automate and customize their specific workflows.With PySherlock, you can perform many tasks, including these:Launch a Sherlock gRPC server and a Sherlock client.Import ECAD files and generate project reports.Define life cycle events and profiles.Generate a stackup and update a stackup layer.Update a project parts list.Perform layer view operations such as updating a mount point’s location.Export a trace or trace reinforcement model for integration with Ansys Workbench.Execute one or more analyses.DependenciesYou must have a licensed copy ofAnsys Sherlockinstalled either on your local machine or a remote machine. To use a remote session, a connection to the
remote machine must be available from your Python program.Documentation and issuesFor comprehensive information on PySherlock, see the latest releasedocumentation.On thePySherlock Issuespage,
you can create issues to submit questions, report bugs, and request new features.
This is the best place to post questions and code.ContributingIf you would like to test or contribute to the development of PySherlock, seeContributein the
PySherlock documentation.LicensePySherlock is licensed under the MIT license.PySherlock makes no commercial claim over Ansys whatsoever. This library extends the functionality
of Ansys Sherlock by adding a Python interface to Sherlock without changing the core behavior
or license of the original software. The use of the interactive control of PySherlock requires
a legally licensed copy of Sherlock.For more information on Sherlock, see theAnsys Sherlockpage on the Ansys website.
|
ansys-simai-core
|
A Python wrapper for Ansys SimAIHow to installAt least two installation modes are provided: user and developer.For usersIn order to install PySimAI, make sure you
have the latest version ofpip. To do so, run:python-mpipinstall-UpipThen, you can simply execute:python-mpipinstallansys-simai-coreFor developersInstalling PySimAI in developer mode allows
you to modify the source and enhance it.Before contributing to the project, please refer to thePyAnsys Developer’s guide. You will
need to follow these steps:Start by cloning this repository:gitclonehttps://github.com/ansys/pysimaiInstall PDM. NB: If you are a Windows user, make sure that Python is installed on your system and it is added to the Path.Use PDM to create a virtual env with the dependencies and activate itFor Linux/Mac:pdminstalleval$(pdmvenvactivate)For Windows:pdminstallInvoke-Expression(pdmvenvactivate)Finally, verify your development installation by running:python-mpipinstalltoxtoxHow to testThis project takes advantage oftox. This tool allows to automate common
development tasks (similar to Makefile) but it is oriented towards Python
development.Using toxAs Makefile has rules,toxhas environments. In fact, the tool creates its
own virtual environment so anything being tested is isolated from the project in
order to guarantee project’s integrity. The following environments commands are provided:tox -e style: will check for coding style quality.tox -e py: checks for unit tests.tox -e py-coverage: checks for unit testing and code coverage.tox -e doc: checs for documentation building process.Raw testingIf required, you can always call the style commands (ruff) or unit testing ones (pytest) from the command line. However,
this does not guarantee that your project is being tested in an isolated
environment, which is the reason why tools liketoxexist.A note on pre-commitThe style checks take advantage ofpre-commit. Developers are not forced but
encouraged to install this tool via:python-mpipinstallpre-commit&&pre-commitinstallDocumentationFor building documentation, you can either run the usual rules provided in theSphinxMakefile, such as:make-Cdoc/html&&opendoc/html/index.htmlHowever, the recommended way of checking documentation integrity is using:tox-edoc&&open.tox/doc_out/index.htmlDistributingPDM commands can help you build or publish the packagepdmbuildpdmpublish
|
ansys-sphinx-theme
|
IntroductionThe Ansys Sphinx theme is an extension of the popularPyData Sphinx themethat is used bynumpy,pandas,pyvista, and many more
scientific Python packages.You use the Ansys Sphinx theme withSphinx,
a Python documentation generator, to create documentation.
The theme’s objective is to ensure that Ansys documentation
looks and behaves consistently.While this theme is primarily used to create documentation
for PyAnsys libraries, you can also use it to create
documentation for any Ansys project with content in
reStructuredText (RST) and Markdown (files).If you are new to using Sphinx, seeSphinx Getting Started.Documentation and issuesIn addition to installation information, theAnsys Sphinx theme documentationprovides information on how you can customize the theme. Because
this documentation is created using this theme, viewing it is
an easy way to preview the theme itself.On theIssues pagefor this repository, you can create issues to submit questions, report bugs,
and request new features. To reach the PyAnsys support team, [email protected] startedInstall theansys-sphinx-themepackage with:python -m pip install ansys-sphinx-themeModify your Sphinxconf.pyfile to usehtml_theme = 'ansys_sphinx_theme'.Development and contributionsIf you want to contribute to the PyAnsys Sphinx theme, install
theansys-sphinx-themepackage in development mode with:git clone https://github.com/ansys/ansys-sphinx-theme.git
python -m pip install -U pip tox
tox -e style,docTo simplify checks, this repository usespre-commit.
You can optionally install and use this tool. For more information, see itsinstallationandusagedocumentation.Before contributing to a PyAnsys library, seeContributingin thePyAnsys Developer’s Guidefor overall guidance, paying particular
attention toHow-tofor
guidelines and best practices.LicenseThis theme is licensed under theMIT License.
|
ansys-systemcoupling-core
|
OverviewPySystemCoupling provides Pythonic access to Ansys System
Coupling. Although this Ansys product exposes its own
Python-based scripting and command line interface, it is embedded
and based on a specific version of Python. In contrast,
PySystemCoupling enables seamless use of System Coupling within the Python
ecosystem, providing additional capabilities, including:Ability to launch System Coupling using a local Ansys installationAccess to APIs to set up and solve coupled analysesFull access to the System Coupling data model via a convenient and Pythonic interfaceInstallationInstall PySystemCoupling with this command:pip install ansys-systemcoupling-coreAlternatively, clone and install PySystemCoupling indevelopment modewith this code:git clone https://github.com/ansys/pysystem-coupling.git
cd pysystem-coupling
python -m pip install --upgrade pip
pip install -e .
pip install .[classesgen]
python scripts\generate_datamodel.pyDocumentation and IssuesFor more information, see theDocumentationpage.Use thePySystemCoupling Issuespage to
post bug reports, questions and feature requests.UsageIt is assumed that an Ansys installation is available and that this installation
includes System Coupling and the participant products needed for the coupled analysis.The System Coupling installation is found by examining the following environment variables
in this order:SYSC_ROOTAWP_ROOTAWP_ROOT241If a variable is set but does not refer to a valid installation, PySystemCoupling
fails at that point, rather than attempting to use the next variable.In a standard user installation, the expectation is that onlyAWP_ROOT241is set.(It is also possible to provide a different version number as an argument to thelaunch()function. This will affect whichAWP_ROOT<version>environment variable is examined.)The System Coupling API is exposed to PySystemCoupling in two forms:A documented interface based on concrete Python classes, following Pythonic conventionsA dynamic interface, undocumented in PySystemCoupling, that replicates the native System Coupling APIBoth forms are strongly related to each other. A key difference in the Pythonic API is that naming
is adjusted, in a generally predictable manner, to follow Python conventions. If you are already
familiar with System Coupling, adjusting to this form, which is the recommended API, should be easy.
However, if you are transitioning existing scripts, the native System Coupling API is made available
as a convenience.NoteWhile most commands should work as expected via the native System Coupling API,
no guarantees can be given because of the nature of how it is exposed.This example shows how to set up and solve an oscillating plate example in the Pythonic API.
It uses Ansys Fluent as the CFD solver.importansys.systemcoupling.coreaspysystemcouplingsyc=pysystemcoupling.launch()setup=syc.setupsetup.add_participant(input_file="mapdl.scp")setup.add_participant(input_file="fluent.scp")## Create interfaces and data transfers by specifying participant regionsinterface_name="interface-1"interface=setup.coupling_interface.create(interface_name)interface.side["One"].coupling_participant="MAPDL-1"interface.side["One"].region_list=["FSIN_1"]interface.side["Two"].coupling_participant="FLUENT-2"interface.side["Two"].region_list=["wall_deforming"]# Use commands to add data transfersforce_transfer_name=setup.add_data_transfer(interface=interface_name,target_side="One",side_one_variable="FORC",side_two_variable="force",)disp_transfer_name=setup.add_data_transfer(interface=interface_name,target_side="Two",side_one_variable="INCD",side_two_variable="displacement",)# Change analysis duration and step sizesetup.solution_control.time_step_size="0.1 [s]"setup.solution_control.end_time="1.0 [s]"# Set output control settingssetup.output_control.option="StepInterval"setup.output_control.output_frequency=2# Start streaming standard output from serversyc.start_output()# Solvesolution=syc.solutionsolution.solve()The Pythonic API partitions commands via three high-levelrootattributes of theSessionclass:setup,solution, andcase. The preceding example
uses both thesetupandsolutionattributes.Thesetupattribute is the largest part of the API. It is where you find all
commands related to populating the settings that define a coupled analysis. This
attribute also provides direct access to the hierarchical data model.Thesolutionattribute is home to commands related to solving an analysis and
examining the solution.Thecaseattribute, which is not used in the preceding example, provides all
commands related to case file management and persistence.While the preceding example uses thepysystemcoupling.launch()method to start the
System Coupling server, alternatively, the server can be started in advance by calling
command line arguments-mcosimgui--grpcport=<host:port>andpysystemcoupling.connect(host, port).This next example shows how to set up the same analysis using the native System Coupling
API. While the code here is less complete than the code shown previously, it should
sufficiently illustrate the differences and connections between the two API forms.importansys.systemcoupling.coreaspysystemcouplingsyc=pysystemcoupling.launch()native_api=syc._native_apinative_api.AddParticipant(InputFile="mapdl.scp")native_api.AddParticipant(InputFile="fluent.scp")interface=native_api.CouplingInterface["interface-1"]interface.Side["One"].CouplingParticipant="MAPDL-1"...native_api.SolutionControl.TimeStepSize="0.1 [s]"...syc.start_output()native_api.Solve()LicensePySystemCoupling is licensed under the MIT license.Theansys-systemcoupling-corepackage makes no commercial claim over Ansys
whatsoever. It extends the functionality of Ansys System Coupling by
adding a Python interface to the System Coupling service without changing the
core behavior or license of the original software. Interactively controlling
System Coupling via PySystemCoupling requires a local copy of System Coupling
and licenses for all Ansys products involved in your coupled analysis.To get a copy of Ansys, visitAnsys.
|
ansys-templates
|
Theansys-templatesrepository holds a collection of useful templates compliant
with PyAnsys guidelines. It also provides theansys-templatescommand line tool
for interactively generating new projects based on previous templates.The main advantages of using this tool are:Building process is fully interactive. There is no need to manually modify files.Output of the project can easily be customized during the rendering process.Generated projects are compliant withPyAnsys Developer’s Guidelines.For information on using this tool, see theAnsys Templates Documentation.How to installUsers can installansys-templatesby running:python -m pip install ansys-templatesThe usage ofpipxis encouraged too. Seeinstalling ansys-templates using
pipx.Basic commandsThe following commands are provided withansys-templates:ansys-templates--help: lists information about the tool.ansys-templateslist: lists all available templates.ansys-templatesnew <template name>: creates a new project from template.Available templatesAvailable templates inansys-templatesare:doc-project: Create a documentation project using Sphinx.pybasic: Create a basic Python Package.pyansys: Create a PyAnsys Python Package project.pyansys-advanced: Create an advanced PyAnsys Python Package project.pyansys-openapi-client: Create an OpenAPI Client Package project.pyace: Create a Python project for any method developers.pyace-flask: Create a Flask project initialized for any developer.pyace-grpc: Create gRPC project initialized for any developer.pyace-fast: Create a FastAPI project initialized for any developer.solution: Create a Solution based on the Solution Application Framework.For Ansys Internal Use OnlyTemplate featuresThe following table summarizes the main properties for each of the templates
available inansys-templates:Templatesetup.pypyproject.tomlActionstox.inirequirements/Dockerdoc-projectXXXpybasicXpyansysXXXpyansys-advancedXXXXXpyansys-openapi-clientpyaceXXXXXXpyace-fastXXXXXXpyace-flaskXXXXXXpyace-grpcXXXXXXsolution “*”XXXXWarning“*” This template is forAnsys Internal Use Only.Demo branchesTo have a better idea on how each template will look once it gets rendered, see
its corresponding demonstration branch.Demo branch fordoc-projectDemo branch forpybasicDemo branch forpyansysDemo branch forpyansys-advanced using flitDemo branch forpyansys-advanced using poetryDemo branch forpyansys-advanced using setuptoolsDemo branch forpyaceDemo branch forpyace-fastDemo branch forpyace-flaskDemo branch forpyace-grpcDemo branch forsolution
|
ansys-test-package
|
Theansys-test-package.
|
ansys-tools-example-coverage
|
ansys-tools-example-coverageTheansys-tools-example-coveragelibrary is intended to assess and report the docstring examples coverage
of modules and submoldules from a given directory.
example-coverage is licensed under theMIT License.What does this library do?ansys-tools-example-coveragedisplays the number of documentation strings containing
examples following either thenumpydocorGoogle-Style.Example usage:python -m ansys.tools.example_coverage -f "path_to_package"
Name Methods Missed Covered
-----------------------------------------------------------------------
my_package.my_module_a.sub_module_a 3 3 0.0%
my_package.my_module_a.sub_module_b 6 3 50.0%
my_package.my_module_a.sub_module_c 1 0 100.0%
my_package.my_module_b 4 1 75.0%
-----------------------------------------------------------------------
Total 14 7 50%InstallationInstall with:pip install ansys-tools-example-coverageIssuesTo post issues, questions, and code, go toexample-coverage Issues.Licenseansys-tools-example-coverageis licensed under the MIT license.
|
ansys-tools-path
|
Library to locate Ansys products in a local machine.How to installAt least two installation modes are provided: user and developer.For usersIn order to installansys-tools-path, make sure you
have the latest version ofpip. To do so, run:python-mpipinstall-UpipThen, you can simply execute:python-mpipinstallansys-tools-pathFor developersInstallingansys-tools-pathin developer mode allows
you to modify the source and enhance it.Before contributing to the project, please refer to thePyAnsys Developer’s guide.
You need to follow these steps:Start by cloning this repository:gitclonehttps://github.com/ansys/ansys-tools-pathCreate a fresh-clean Python environment and activate it:# Create a virtual environmentpython-mvenv.venv# Activate it in a POSIX systemsource.venv/bin/activate# Activate it in Windows CMD environment.venv\Scripts\activate.bat# Activate it in Windows Powershell.venv\Scripts\Activate.ps1Make sure you have the latest required build system and doc, testing, and CI tools:python-mpipinstall.[tests]python-mpipinstall.[doc]python-mpipinstall.[build]Install the project in editable mode:python-mpipinstall--editableansys-tools-pathHow to testingIf required, you can always call the style commands (black,isort,flake8…) or unit testing ones (pytest) from the command line. However,
this does not guarantee that your project is being tested in an isolated
environment, which is the reason why tools liketoxexist.A note on pre-commitThe style checks take advantage ofpre-commit. Developers are not forced but
encouraged to install this tool via:python-mpipinstallpre-commit&&pre-commitinstallDocumentationFor building documentation, you can either run the usual rules provided in theSphinxMakefile, such us:make-Cdoc/html&&your_browser_namedoc/html/index.htmlDistributingIf you would like to create either source or wheel files, start by installing
the building requirements and then executing the build module:python-mpipinstall.[build]python-mbuildpython-mtwinecheckdist/*
|
ansys-tools-protoc-helper
|
A utility to compile.protofiles to Python source when building the package wheel. It supports dependencies to.protofiles of different packages.QuickstartThe simplest way to get started is using thetemplate repository.Manual useTo manually enable the use ofansys-tools-protoc-helperin your project, the following things need to be defined:Apyproject.tomlfile with the following contents:[build-system]
requires = ["setuptools>=42.0", "wheel", "ansys-tools-protoc-helper", <additional_dependencies>]
build-backend = "setuptools.build_meta:__legacy__"where<additional_dependencies>are the packages that you depend on for.protofiles.In thesetuptoolsconfiguration (eithersetup.cfgorsetup.py). We only show thesetuptools.setup()keywords (setup.pyvariant) here:Run-time dependencies on the same<additional_dependencies>used above:install_requires=[grpcio,protobuf,<additional_dependencies>],Refer to thegRPC version strategysection for details on whichgrpcandprotobufversions can be used.Thepackage_datadeclares additional file names which are included in the package:package_data={"":["*.proto","*.pyi","py.typed"],}Note that*.protois only needed if other packages should be able to depend on the*.protofiles defined in your package.Thepy.typedfile is used to communicate that the package contains type information, seePEP 561. This file needs to be manually added.Thecmdclassis used to specify that somesetuptoolscommands should be executed byansys-tools-protoc-helper:fromansys.tools.protoc_helperimportCMDCLASS_OVERRIDEsetup(<...>,cmdclass=CMDCLASS_OVERRIDE)The two commands which are overridden can also be specified individually. This may be useful in particular if you want to use thesetup.cfgformat:fromansys.tools.protoc_helperimportBuildPyCommand,DevelopCommandsetup(<...>,cmdclass={"build_py":BuildPyCommand,"develop":DevelopCommand})If other projects should be able to depend on the.protofiles contained in your project, anentry pointneeds to be defined declaring the presence of the*.protofiles:entry_points={"ansys.tools.protoc_helper.proto_provider":{"<your.package.name>=<your.package.name>"},},where<your.package.name>is the _importable_ name of your package. In other words,import <your.package.name>should work after installing the package.By default, the.protofiles will be copied toyour/package/name. If a different location should be used, append a semicolon to the entry point name, followed by the dot-separated target location:entry_points={"ansys.tools.protoc_helper.proto_provider":{"<your.package.name>:<target.location>=<your.package.name>"},},For a complete example, see thetest/test_data/testpkg-greeter-protospackage.gRPC version strategyTheansys-tools-protoc-helperpins the versions ofgRPCandprotobufthat it depends on, in thedependencies = ...section of thepyproject.tomlfile.For your own project, you can use any version ofgrpcioandprotobufthat’s newer (or equal) to the version pinned here, as long as it is the same major version.For example, ifansys-tools-protoc-helperpinsdependencies = [
"grpcio-tools==1.20.0",
"protobuf==3.19.3",
]your own dependencies could begrpcio-tools~=1.20,protobuf~=3.19(using the~=compatible version operator).NoteTheprotoccompiler version used is determined by thegrpcio-toolspackage,nottheprotobufdependency. Thegrpcio-tools==1.20.0usesprotoc==3.7.0.The versions pinned byansys-tools-protoc-helperwere originally chosen as follows:The first version ofgrpcio-toolsfor which binary wheels are available on PyPI, for at least one of the Python versions we support.The first version ofprotobufwhich is compatible withmypy-protobuf, for generating type stubs.Upgrade plansThe current plan for upgradinggrpcio-toolsandprotobufis as follows:ansys-tools-protoc-helperversionrelease dategrpcio-toolsversionprotobufversionprotocversion0.2.x2022-12-091.20.x3.19.33.7.x0.3.x2023-02-201.25.x3.19.33.8.x0.4.x2023-02-201.44.x3.19.33.19.20.5.xTBD1.49.x4.21.x3.21.5The strategy for these upgrades is as follows:
- Upgradegrpcio-toolsas necessary. For example,0.5.xenables building with Python3.11.
- Match the version ofprotobufto the version ofprotocbundled intogrpcio-tools, or at least3.19.3.
- Each upgrade is a breaking upgrade for the semantic version. Since we are currently using0.xversions, the minor version is bumped.TheprotobufPython runtime introduced a backwards-incompatible change with version4.21(matching protoc release3.21). Code generated withprotoc==3.19or newer should be compatible with the4.xruntime, which corresponds to the0.4release ofansys-tools-protoc-helper.If you need to support a specificolderversion of protobuf and / or gRPC, we encourage pinningansys-tools-protoc-helperto its minor version.
|
ansys-tools-protos-generator
|
This package allows you to automatically generate a python package
from proto files stored according to gRPC proto file conventions.InstallationInstall the python packaging tool with:pip install ansys-tools-protos-generatorUsageOnce installed, this package can be run directly from the command line with:python -m ansys.tools.protos_generator <directory-containing-protosfiles>Theprotos-samplesdirectory contains a simple sample service
containing the following directory structure.─ansys
│ ├───api
│ │ ├───sample
│ │ │ ├───v1
│ │ │ │ ├───sample.proto
│ │ │ │ └───VERSIONRunning:python -m ansys.tools.protos_generator ansys/api/sample-example/v1Will generate the following python package:dist/ansys-api-sample-v1-0.5.3.tar.gzThis package can then be installed via:pip install dist/ansys-api-sample-v1-0.5.3.tar.gzOr uploaded to pypi with:twine upload dist/ansys-api-sample-v1-0.5.3.tar.gzContactalexander.kaszynski@ansys.comfor the token and credentials to
upload to pypi under the pyansys account.Non-Default DirectoryYou can change the default directory to a non-default directory with:python -m ansys.tools.protos_generator <protosfiles_path> <outdir>For more details, run:python -m ansys.tools.protos_generator -hRun from within PythonYou can run this within python with:fromansys.tools.protos_generator.generatorimportpackage_protosprotosfiles_path='proto-samples/ansys/api/sample/v1/'outdir='C:/tmp'# or Linux: '/tmp'dist_file=package_protos(protosfiles_path,outdir)Ansys gRPC Directory Structure - StandardsIn the gRPC proto file naming and directory convention see (gRPC
standards), each module is placed in a
directory tree that contains the origin of the module. The origin of
all modules should beansys, followed byapi, followed by<product/service>.For example─ansys
│ ├───api
│ │ ├───<product/service>
│ │ │ ├───v1
│ │ │ │ └───service.proto
│ │ │ │ └───other_service.proto
│ │ │ │ └───VERSIONThis convention follows thegRPC standardsexcept for theVERSIONfile containing a singlesemantic versionstring. Due to the complexity of Ansys
services, thevXversion cannot be used to fully describe state of
the version of the service. For example, if the service were to add a
single message to a service, we need a way of tracking that in the
version of our auto-generated gRPC interface files and packages. Hence
a semantic version.There are other advantages to having a semantic version, namely that
python packages containing the autogenerated gRPC interface files will
also have this version. This will give any downstream dependencies
the ability to depend on a compatible API. For example, if higher
level package requires a certain version of autogenerated gRPC
package:ansys.<product>.<feature>==0.2.0 depends on ansys.api.<product>.v1==0.8.0
ansys.<product>.<feature>==0.3.0 depends on ansys.api.<product>.v1==0.9.0This way, you can maintain backwards compatibility with various
versions of a product for the entire dependency chain without
encountering forwards/backwards compatibility issues.Note that we still usevX. This is required by Google gRPC APIs
and affords us the ability to expose two APIs similtaniously from a
gRPC service. For example, both av1andv2could be exposed
similtaniously from a service, each with their own semantic version to
describe the granular state of that API.This will be handled manually by creating a new directory containing
the next version of the API you choose to expose.─ansys
│ ├───api
│ │ ├───sample
│ │ │ ├───v1
│ │ │ │ ├───sample.proto
│ │ │ │ └───VERSION
│ │ │ ├───v2
│ │ │ │ ├───sample.proto
│ │ │ │ └───VERSIONFor all other questions regarding gRPC standards, please referencegRPC Documentation,gRPC Motivation and
Design Principles, andAPI
Design Guide.DevelopmentRun unit testing with:git clone https://github.com/pyansys/pyansys-protos-generator.git
cd pyansys-protos-generator
pip install -e .
pip install requirements_test.txt
pytest -v
|
ansys-tools-repo-sync
|
Theansys-tools-repo-synclibrary is intended to synchronize the content
of two different repositories.What does this library do?For instance, due to intellectual properties concerns, it might not be possible
to expose publicly the entire content of a private repository.
Its owner could decide to have a second repository, a public one.
Part of the content for this public repo would come from the private repository.ansys-tools-repo-syncallows you to do so by copying a folder and its content
from one repo to the other.By default, nothing is synced to the secondary repository (in order to avoid undesired
content). For that purpose, users have to provide amanifestfile (in ASCII format)
that contains regular expressions for the files accepted.For example, if we wanted to sync all*.pyfiles, one should generate amanifestfile as follows:*.pyHow to use it?A common usage for this tool consist to integrate it in one of your CI/CD pipeline or workflow.
Firstly, the tool must be installed.pipinstallansys-tools-repo-syncThen, it can be used in the considered workflow with the appropriate arguments.Run it as follows:repo-sync\--token<token>\--owner<organization-name>\--repository<repository-name>\--from-dir<path-to-dir-containing-files-to-sync>\--to-dir<target-dir-for-sync>\--include-manifest<path-to-manifest>The options above arecompulsoryin order to run the tool. If an option is missing,
the operation will fail. For more information on all the available options for this tool,
users can run:repo-sync--helpNoteThe--dry-runflag can be set while establishing the entire
workflow for the first time. It helps preventing unnecessary commits
of sensitive data. It will print the content expected to be committed in the
public repository.IssuesTo post issues, questions, and code, go toansys-tools-repo-sync Issues.Licenseansys-tools-repo-syncis licensed under the MIT license.
|
ansys-turbogrid-api
|
PyTurboGridThis Python package contains the PyTurboGrid back end. It is a private repo.
|
ansys-turbogrid-core
|
PyTurboGrid is a Python wrapper forAnsys TurboGrid, a high-quality turbomachinery
meshing software app. To run PyTurboGrid, you must have access to a licensed local copy
of TurboGrid. PyTurboGrid supports Ansys TurboGrid 2023 R2 and later.InstallationTheansys-turbogrid-corepackage supports Python 3.8, 3.9, 3.10 and 3.11 on Windows and Linux. Two modes
of installation are available:User installationDeveloper installationUser installationTo use PyTurboGrid, you must install theansys-turbogrid-corepackage fromPyPI.To ensure that you have the latest version ofpip, run this command:python-mpipinstall-UpipTo install PyTurboGrid, run this command:python-mpipinstallansys-turbogrid-coreDeveloper installationA developer installation consists of cloning thepyturbogridrepository
and installing the project in editable mode. When you install PyTurboGrid from
source code, you can modify and enhance the code.Overall guidance on contributing to a PyAnsys library appears in theContributingtopic
in thePyAnsys Developer’s Guide. Ensure that you are thoroughly familiar
with thisguidebefore attempting to
contribute to PyTurboGrid.Clone thepyturbogridrepository:gitclonehttps://github.com/ansys/pyturbogrid.gitTo avoid incompatibilites in requirements when working in multiple
Python projects, create and activate a virtual environment. For
more information, seeVirtual environmentsin thePyAnsys
Developer’s Guide.To ensure that you have the latest version ofpip, run this command:python-mpipinstall-UpipAssuming that your current working directory is the top-level directory
of your locally clonedpyturbogridrepository, install PyTurboGrid
from this local repository in editable mode by running this command:python-mpipinstall-e.RequirementsYou must have a licensed local installation of Ansys TurboGrid 2023 R2 or later.TheAWP_ROOTxxxenvironment variable, wherexxxis the three-digit
Ansys version, allows PyTurboGrid to find your local TurboGrid installation.A Windows installation automatically sets this root environment variable.
For example, if you install Ansys 2023 R2 in the default directory,
the installer sets theAWP_ROOT232environment variable toC:\ProgramFiles\ANSYS Inc\v232.A Linux installation does not automatically set this root environment
variable. For example, if you install Ansys 2023 R2 in the default
directory, you must manually set theAWP_ROOT232environment
variable to/usr/ansys_inc/v232.License and acknowledgmentsPyTurboGrid is licensed under the MIT license.PyTurboGrid makes no commercial claim over Ansys whatsoever. This library extends the
functionality of Ansys TurboGrid by adding a Python interface to TurboGrid without
changing the core behavior or license of the original software. The use of the
interactive control of PyTurboGrid requires a legally licensed local copy of TurboGrid.For more information on TurboGrid, see theAnsys TurboGridpage on the Ansys website.
|
ansys-units
|
OverviewPyAnsys Units provides a Pythonic interface for units, unit systems, and unit
conversions. Its features enable seamless setup and usage of physical
quantities, enabling you to perform these tasks:Instantiate physical quantities from a unit string, list of dimensions, or
quantity map.Perform unit conversions and arithmetic operations between quantity objects or
real values.Create custom units and unit systems.Documentation and issuesDocumentation for the latest stable release of PyAnsys Units is hosted atPyAnsys Units documentation.In the upper right corner of the documentation’s title bar, there is an option for
switching from viewing the documentation for the latest stable release to viewing
the documentation for the development version or previously released versions.On thePyAnsys Units Issuespage, you can
create issues to report bugs, and request new features. On thePyAnsys Units Discussionspage or theDiscussionspage on the Ansys Developer portal, you can post questions, share ideas, and get community feedback.To reach the project support team, [email protected] supports Python 3.9 through Python 3.11 on Windows
and Linux.Install the latest release fromPyPIwith this command:pip install ansys-unitsIf you plan on doing localdevelopmentof PyAnsys Units with Git, install the latest release with
these commands:git clone https://github.com/ansys/pyansys-units.git
cd pyansys-units
pip install pip -U
pip install -e .Getting startedBasic usagePyAnsys Units supports defining quantities and their units in a intuitive way.
Start by importing theansys.unitspackage:importansys.unitsasansunitsYou can instantiate quantities with one of four methods:# Using unit stringsvolume=ansunits.Quantity(value=1,units="m^3")volume.value# 1.0volume.units.name# "m^3"# Using Unit instancesureg=ansunits.UnitRegistry()mass=ansunits.Quantity(value=1,units=ureg.kg)volume.value# 1.0volume.units.name# "kg"# Using base dimensionsdims=ansunits.BaseDimensionsdimensions=ansunits.Dimensions({dims.LENGTH:1,dims.TIME:-2})acceleration=ansunits.Quantity(value=3,dimensions=dimensions)acceleration.value# 3.0acceleration.units.name# "m s^-2"# Using the quantity maptorque=ansunits.Quantity(5,quantity_map={"Torque":1})torque.value# 5.0torque.units.name# "N m"torque.si_units# "kg m^2 s^-2"You can instantiate unit systems with one of two methods:# Use a pre-defined unit systemsi=ansunits.UnitSystem(unit_sys="SI")si.base_units# ['kg', 'm', 's', 'K', 'delta_K', 'radian', 'mol', 'cd', 'A', 'sr']# Custom unit systems are defined by passing selected base units. Any unit# type that is not given will be filled with the SI equivalent.ureg=ansunits.UnitRegistry()dims=ansunits.BaseDimensionssys=ansunits.UnitSystem(base_units={dims.MASS:ureg.slug,dims.LENGTH:ureg.ft,dims.TEMPERATURE:ureg.R,dims.TEMPERATURE_DIFFERENCE:ureg.delta_R,dims.CHEMICAL_AMOUNT:ureg.slugmol,})sys.base_units# ['slug', 'ft', 's', 'R', 'delta_R', 'radian', 'slugmol', 'cd', 'A', 'sr']ExamplesPerform arithmetic operations:importansys.unitsasansunitsdeg=ansunits.Quantity(90,"degree")math.sin(deg)# 1.0v1=ansunits.Quantity(10.0,"m s^-1")v2=ansunits.Quantity(5.0,"m s^-1")v3=v1-v2v3.value# 5.0vpow=v1**2vpow.value# 100.0vpow.units# "m^2 s^-2"Directly convert values to another set of units:importansys.unitsasansunitsflbs=ansunits.Quantity(1,"lb ft^-1 s^-1")flbs.value# 1pas=flbs.to("Pa s")pas.value# 1.4881639435695542pas.units.name# 'Pa s'Use a custom unit system to perform conversions:importansys.unitsasansunitsureg=ansunits.UnitRegistry()dims=ansunits.BaseDimensionssys=ansunits.UnitSystem(base_units={dims.MASS:ureg.slug,dims.LENGTH:ureg.ft,dims.TEMPERATURE:ureg.R,dims.TEMPERATURE_DIFFERENCE:ureg.delta_R,dims.CHEMICAL_AMOUNT:ureg.slugmol,})v=ansunits.Quantity(10,"kg m s^2")v2=sys.convert(v)v2.value# 2.2480894309971045v2.units.name# 'slug ft s^2'LicensePyAnsys Units is licensed under the MIT license. For more information, see theLICENSEfile.
|
ant
|
IntroductionPython implementation of the ANT, ANT+, and ANT-FS protocols. For more
information about ANT, seehttp://www.thisisant.com/.Can be used to communicate with ANT nodes using an ANT stick (USB).This project came to be when I tried to download data for analysis from my
ANT+/ANT-FS enabled running watch under GNU/Linux. This eventually lead me to
attempting to port ANT_LIB and ANT_DLL (by Dynastream) to Linux. However, I
didn’t quite like the library, the protocol is well documented and trivial to
implement, and I was going to have to write a ctypes-based wrapper afterwards
since I was only going to use the library from Python. Thus, I decided to
write a pure Python implementation.ContactYou can reach me via e-Mail and Google Talk/Jabber at:martin at NOSPAM martinvillalba dot comDocumentationDocumentation will be a bit scarse for the time being, but everything public
should have at least a docstring by the time I make the first stable release.LicenseReleased under the MIT/X11 license. See LICENSE for the full text.Install% python setup.py installDevelopSee DEVELOP.md for details.
|
ant1Interface
|
前言:
这个代码库主要是用来实现引擎调用算法模型时,输入输出接口的解析。bot中相应的接口定义详见https://yuque.antfin.com/crtpg4/dp5u2i/ciww6f#qNMmC两种import方式:
1. 如果使用antnlp,参考antnlp/adabrain/common/interface/ant1/demo.py
2. 如果不使用antnlp, 直接安装pypi包,pip install -ihttps://test.pypi.org/simple/ant1
在代码里面引入包 import ant1
引入具体包 from ant1 import decoder
务必在函数每次被调用的时候,进行初始化
decode_builder = decoder.DecoderParamsBuilder(input_proto_type=INPUT_PROTO_TYPE)组件内的解析函数定义使用详见antnlp/adabrain/common/interface/ant1/docs
|
ant2mvn
|
ant2mvn: making move Ant to Maven be easier.
|
anta
|
Arista Network Test Automation (ANTA) FrameworkANTA is Python framework that automates tests for Arista devices.ANTA provides aset of teststo validate the state of your networkANTA can be used to:Automate NRFU (Network Ready For Use) test on a preproduction networkAutomate tests on a live network (periodically or on demand)ANTA can be used with:TheANTA CLIAs aPython libraryin your own application# Install ANTA CLI$pipinstallanta# Run ANTA CLI$anta--help
Usage:anta[OPTIONS]COMMAND[ARGS]...AristaNetworkTestAutomation(ANTA)CLI
Options:--versionShowtheversionandexit.--log-fileFILESendthelogstoafile.IflogginglevelisDEBUG,onlyINFOorhigherwillbesenttostdout.[envvar:ANTA_LOG_FILE]-l,--log-level[CRITICAL|ERROR|WARNING|INFO|DEBUG]ANTAlogginglevel[envvar:ANTA_LOG_LEVEL;default:INFO]--helpShowthismessageandexit.
Commands:checkCommandstovalidateconfigurationfilesdebugCommandstoexecuteEOScommandsonremotedevicesexecCommandstoexecutevariousscriptsonEOSdevicesgetCommandstogetinformationfromorgenerateinventoriesnrfuRunANTAtestsondevices[!WARNING]
The ANTA CLI options have changed after version 0.11 and have moved away from the top levelantaand are now required at their respective commands (e.g.anta nrfu). This breaking change occurs after users feedback on making the CLI more intuitive. This change should not affect user experience when using environment variables.DocumentationThe documentation is published onANTA package website. Also, ademo repositoryis available to facilitate your journey with ANTA.Contribution guideContributions are welcome. Please refer to thecontribution guideCreditsThank you toAngélique Phillipps,Colin MacGiollaEáin,Khelil Sator,Matthieu Tache,Onur Gashi,Paul Lavelle,Guillaume MulocherandThomas Grimonetfor their contributions and guidances.
|
antagonistic-game
|
No description available on PyPI.
|
antagonistic-game-solver
|
No description available on PyPI.
|
antakia
|
Welcome to AntakIA !AntakIA is an open-source tool from AI-vidence to explain ML black box models. Seedoc.Here is a quick overview on AntakIA:See full video onYoutube.InstallAntakIA is available onPyPI:pip install antakiaRunning example notebooksOnce you've installedantakia, you can download some of our notebook examples from our repohere.Then, launch a Jupyter server from the notebook file (.ipynb) location :jupyter notebook # or jupyter labYou'll find a complete tutorial for our California housing example here :https://doc.antakia.ai[!IMPORTANT]
If you're using a virtual env, it's handy to be able to chose it from Jupyter's kernel list. Do the following :python -m ipykernel install --user --name your_venv_name --display-name "My great virtual env"Online demoYou can giveantakiaa try online :https://demo.antakia.aiLog asdemowith passwordantakia.
Note it runs on a simple server and may be busy. You may want to log with other accounts :demo1todemo5are accepted with the same password.Run with Docker[!IMPORTANT]
Be sure to have a Docker engine running on your computer (ie. launch Docker Desktop)docker build -t antakia .
docker run -p 8888:8888 antakiaIn your Terminal, click on thehttp://127.0.0.1:8888/lab?token=WHATEVER_YOUR_TOKEN_IS URLlink.
|
antakia-ac
|
Auto-clustering algorithms for AntakIA
To protect our intellectual property, this package is obfuscated
|
antakia-core
|
This modules provides various key classes for AntakIA.
|
antannotator
|
AntAnnotatorJupyterLab tool for data annotations for machine learning routines.Just drop your python data into widged and label it.FeaturesData persistenceData is automatically persisted on disk in .json format.UIAnnotation UI witch allow to do annotationUsage examplefrom antannotator.annotation_controller import AnnotationController
from antannotator.persistence import AutoEventStorage, AutoAnnotationTaskStorage, AnnotationSample
# Select directory where annnotation task data will be stored
event_storage = AutoEventStorage.get_event_storage("/tmp/annotator/events")
task_storage = AutoAnnotationTaskStorage.get_task_storage("/tmp/annotator/tasks")
controller = AnnotationController(task_storage=task_storage, event_storage=event_storage)
#
options = {"literature": "Classical literature",
"songs": "20th Century Songs",
"other":"Other"}
# load samples to annotate
samples = [ AnnotationSample(sample_id=f"id_1",
task_data=f"We passed upon the stair\nWe spoke of was and when\nAlthough I wasn't there\nHe said I was his friend",
available_options=options,
hidden_info=None,
visible_info=None),
AnnotationSample(sample_id=f"id_2",
task_data=f"It was many and many a year ago,\nIn a kingdom by the sea",
available_options=options,
hidden_info=None,
visible_info=None),
AnnotationSample(sample_id=f"id_3",
task_data=f"On a dark desert highway, cool wind in my hair\nWarm smell of colitas, rising up through the air",
available_options=options,
hidden_info=None,
visible_info=None)]
controller.append_samples(samples)
# start annotations process
controller.do_annotaions()Installationpip install antannotatorRoadmapMultichoice text classificationMulticlass, multichoise text classificationOne choice text classificationOne choice classification. (Task adavance immediately user celect a option)Free inputFree user input. (For example for summarization task)
|
antar
|
No description available on PyPI.
|
antarctic
|
AntarcticProject to persist Pandas data structures in a MongoDB database.InstallationpipinstallantarcticUsageThis project (unless the popular arctic project which I admire) is based on top ofMongoEngine.
MongoEngine is an ORM for MongoDB. MongoDB stores documents. We introduce a new field and extend the Document class
to make Antarctic a convenient choice for storing Pandas (time series) data.FieldsWe introduce first a new field --- the PandasField.frommongoengineimportDocument,connectfromantarctic.pandas_fieldimportPandasField# connect with your existing MongoDB (here I am using a popular interface mocking a MongoDB)client=connect(db="test",host="mongomock://localhost")# Define the blueprint for a portfolio documentclassPortfolio(Document):nav=PandasField()weights=PandasField()prices=PandasField()The portfolio objects works exactly the way you think it worksp=Portfolio()p.nav=pd.Series(...).to_frame(name="nav")p.prices=pd.DataFrame(...)p.save()print(p.nav["nav"])print(p.prices)Behind the scenes we convert the Frame objects into parquet bytestreams and
store them in a MongoDB database.The format should also be readable by R.DocumentsIn most cases we have copies of very similar documents, e.g. we store Portfolios and Symbols rather than just a Portfolio or a Symbol.
For this purpose we have developed the abstractXDocumentclass relying on the Document class of MongoEngine.
It provides some convenient tools to simplify looping over all or a subset of Documents of the same type, e.g.fromantarctic.documentimportXDocumentfromantarctic.pandas_fieldimportPandasFieldclient=connect(db="test",host="mongodb://localhost")classSymbol(XDocument):price=PandasField()We define a bunch of symbols and assign a price for each (or some of it):s1=Symbol(name="A",price=pd.Series(...).to_frame(name="price")).save()s2=Symbol(name="B",price=pd.Series(...).to_frame(name="price")).save()# We can access subsets likeforsymbolinSymbol.subset(names=["B"]):print(symbol)# often we need a dictionary of Symbols:Symbol.to_dict(objects=[s1,s2])# Each XDocument also provides a field for reference data:s1.reference["MyProp1"]="ABC"s2.reference["MyProp2"]="BCD"# You can loop over (subsets) of Symbols and extract reference and/or series dataprint(Symbol.reference_frame(objects=[s1,s2]))print(Symbol.frame(series="price",key="price"))print(Symbol.apply(func=lambdax:x.price["price"].mean(),default=np.nan))The XDocument class is exposing DataFrames both for reference and time series data.
There is anapplymethod for using a function on (subset) of documents.Database vs. DatastoreStoring json or bytestream representations of Pandas objects is not exactly a database. Appending is rather expensive as one would have
to extract the original Pandas object, append to it and convert the new object back into a json or bytestream representation.
Clever sharding can mitigate such effects but at the end of the day you shouldn't update such objects too often. Often practitioners
use a small database for recording (e.g. over the last 24h) and update the MongoDB database once a day. It's extremely fast to read the Pandas objects
out of such a construction.Often such concepts are called DataStores.
|
antarctic-plots
|
antarctic_plots is now polartoolkitThis package has been renamed. Usepip install polartoolkitinstead.Please rename all imports fromimport antarctic_plotstoimport polartoolkit.New package:https://pypi.org/project/polartoolkit/
|
antares
|
Antares is an engine to automatically generate optimized kernels for multi-platform
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.