abqcy.cli
Module Contents
Classes
The |
Attributes
- class AbqcyCLI[source]
The
abqcy
command-line interface.- compile(script: str, *, exclude: list = None, nthreads: int = 0, aliases: dict = None, quiet: bool = False, force: bool = False, language: str = None, exclude_failures: bool = False, annotate: bool = True, **kwargs)[source]
Compile a Cython script to an Abaqus user subroutine as an object file.
- Parameters:
script (
str
) – The path to the Cython script to compile.exclude (
list
, optional) – When passing glob patterns asscript
, you can exclude certain module names explicitly by passing them into theexclude
option.nthreads (
int
, optional) – The number of concurrent builds for parallel compilation (requires themultiprocessing
module).aliases (
dict
, optional) – If you want to use compiler directives like# distutils: ...
but can only know at compile time (when running thesetup.py
) which values to use, you can use aliases and pass a dictionary mapping those aliases to Python strings when callingcythonize()
. As an example, say you want to use the compiler directive# distutils: include_dirs = ../static_libs/include/
but this path isn’t always fixed and you want to find it when running thesetup.py
. You can then do# distutils: include_dirs = MY_HEADERS
, find the value ofMY_HEADERS
in thesetup.py
, put it in a python variable calledfoo
as a string, and then callcythonize(..., aliases={'MY_HEADERS': foo})
.quiet (
bool
, optional) – If True, Cython won’t print error, warning, or status messages during the compilation.force (
bool
, optional) – Forces the recompilation of the Cython modules, even if the timestamps don’t indicate that a recompilation is necessary.language (
str
, optional) – To globally enable C++ mode, you can passlanguage='c++'
. Otherwise, this will be determined at a per-file level based on compiler directives. This affects only modules found based on file names. Extension instances passed intocythonize()
will not be changed. It is recommended to rather use the compiler directive# distutils: language = c++
than this option.exclude_failures (
bool
, optional) – For a broad ‘try to compile’ mode that ignores compilation failures and simply excludes the failed extensions, passexclude_failures=True
. Note that this only really makes sense for compiling.py
files which can also be used without compilation.annotate (
bool
, optional) – Whether to generate an HTML file with annotations, by default True.kwargs – Additional keyword arguments to pass to the
cythonize
function.
- run(model: str, *, user: str = None, job: str = None, output: str = None, post: str = None, visualization: str = None, **kwargs)[source]
Run Abaqus jobs.
- Parameters:
model (
str
) – The path to the input file or a Python script to create the input file.user (
str
) – The name of the user subroutine, if it is a Cython/Pure Python script, it will be compiled to an object file automatically. If a companion.pxd
file is found, it will be copied to the output directory along with the Cython/Pure Python script.job (
str
, optional) – The name of the job, by default the model name without the extension.output (
str
, optional) – The path to the output directory, by default the current directory.post (
str
, optional) – The Python script to run after finishing the job to post-process the results. In the output script, a placeholder{odb}
will be replaced with the path to the output database file.visualization (
str
, optional) – The Python script to run after finishing the job to visualize the results. Typically, this script will plot a figure based on the data saved by the post-processing script.kwargs – Additional keyword arguments to pass to the
abaqus
command to run the job.