Note: The default ITS GitLab runner is a shared resource and is subject to slowdowns during heavy usage.
You can run your own GitLab runner that is dedicated just to your group if you need to avoid processing delays.

Verified Commit 63a40aa0 authored by Qusai Al Shidi's avatar Qusai Al Shidi 💬
Browse files

@cdha this is great and I made a few changes to keep in mind.

- Google style docstrings use `Args:` and not `Arguments:`
- Stick to markdown *everywhere*.
- The first line in a big docstring `"""` is always a one line summary

Please confirm before I merge :).
parent d3196274
...@@ -26,6 +26,7 @@ __email__ = 'qusai@umich.edu' ...@@ -26,6 +26,7 @@ __email__ = 'qusai@umich.edu'
import sys import sys
from . import paramin from . import paramin
from . import io from . import io
from . import tecplottools
  • I recommend not importing tecplottools by default. While I don't think the import itself will cause problems (Tecplot doesn't look for a license until you actually try to do something to data) I don't think the user will be able to use the functions in the module without a license. So for a user who never touches tecplot it would be a bit pointless to require them to install the pytecplot package, which I believe is what would happen if it's imported by default.

Please register or sign in to reply
from . import web from . import web
assert sys.version_info >= (3, 6), "swmfpy requires Python >=3.6. Sorry :(." assert sys.version_info >= (3, 6), "swmfpy requires Python >=3.6. Sorry :(."
......
#!/usr/bin/env python #!/usr/bin/env python
"""Tools for working with the Tecplot visualization software. Requires an """Tools for working with the Tecplot visualization software.
active Tecplot license and the pytecplot python package. pytecplot ships with
Tecplot 360 2017 R1 and later versions but it is recommended that you install Requires an active Tecplot license and the pytecplot python package.
the latest version with `pip install pytecplot`. See the pytecplot pytecplot ships with Tecplot 360 2017 R1 and later versions
documentation for more details about installation but it is recommended that you install the latest version with
(https://www.tecplot.com/docs/pytecplot/install.html). See also `pip install pytecplot`.
TECPLOT.markdown for tips targeted to SWMF users. See the pytecplot documentation for more details about
[installation](https://www.tecplot.com/docs/pytecplot/install.html).
See also [TECPLOT](TECPLOT.markdown) for tips targeted to SWMF users.
Some useful references: Some useful references:
- Tecplot User's Manual - [Tecplot User's Manual](download.tecplot.com/360/current/360_users_manual.pdf)
http://download.tecplot.com/360/current/360_users_manual.pdf - [Tecplot Scripting Guide](download.tecplot.com/360/current/360_scripting_guide.pdf)
- Tecplot Scripting Guide - [Pytecplot documentation](www.tecplot.com/docs/pytecplot/index.html)
http://download.tecplot.com/360/current/360_scripting_guide.pdf
- Pytecplot documentation
https://www.tecplot.com/docs/pytecplot/index.html
""" """
__all__ = [ __all__ = [
'apply_equations' 'apply_equations'
...@@ -24,20 +23,20 @@ __email__ = 'cdha@@umich.edu' ...@@ -24,20 +23,20 @@ __email__ = 'cdha@@umich.edu'
import tecplot import tecplot
def apply_equations(eqn_path: str, verbose: bool = False): def apply_equations(eqn_path: str, verbose: bool = False):
""" """Apply an equations file in the Tecplot macro format to the active dataset
Apply an equations file in the Tecplot macro format to the active Tecplot
dataset. Please reference the Tecplot User's Manual for more details on Please reference the Tecplot User's Manual for more details on
equation files and syntax. It is recommended to use this function with eqn equation files and syntax. It is recommended to use this function with eqn
files generated with the Tecplot GUI. See TECPLOT.markdown for tips on using files generated with the Tecplot GUI.
pytecplot. See [TECPLOT](TECPLOT.markdown) for tips on using pytecplot.
Arguments: Args:
eqn_file_path: The path to the equation macro file (typically with eqn_file_path (str): The path to the equation macro file (typically with
extension `.eqn`). extension `.eqn`).
verbose: (Optional) Whether or not to print the equations as they are verbose (bool): (Optional) Whether or not to print the equations as they are
applied. Default behavior is silent. applied. Default behavior is silent.
Example: Examples:
```python ```python
import tecplot import tecplot
import swmfpy.tecplottools as tpt import swmfpy.tecplottools as tpt
......
  • Also, thank you so much @cdha !!

  • 99% awesome! I had a comment recommending to not import the module by default however. And thanks to you as well, I will bear this formatting in mind in the future.

Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment