WATTS provides a set of Python classes that can manage simulation workflows for multiple codes where information is exchanged at a coarse level

Related tags

Miscellaneouswatts
Overview

WATTS

License

WATTS (Workflow and Template Toolkit for Simulation) provides a set of Python classes that can manage simulation workflows for multiple codes where information is exchanged at a coarse level. For each code, input files rely on placeholder values that are filled in based on a set of user-defined parameters.

WATTS is being developed with support from Argonne National Laboratory. For any questions, please contact [email protected].

Installation

Documentation

To build the documentation, you can run:

  • cd doc
  • pip install -r requirements.txt
  • make html

Then you can view the documentation with:

  • google-chrome build/html/index.html

or replace google-chrome with your favorite browser.

Comments
  • Added unit conversion capability

    Added unit conversion capability

    This PR adds the unit-conversion capability to WATTS:

    • params can now accept dictionary where the value, the current_unit, and the new_unit of a parameter are specified.
    • new_unit is optional. If not specified, S.I. units will be used.
    • Changes are also made to MOOSE and OpenMC plugins to automatically convert the units of a parameter to S.I and CGS, respectively. With the changes, there is no need to define the same parameter twice in different units to accommodate for the different units requirements in SAM/MOOSE and OpenMC.
    opened by zhieejhia93 12
  • RELAP5-3D plugin

    RELAP5-3D plugin

    A plugin to execute RELAP5-3D with WATTS. Several things to highlight:

    • The default run_proc() does not work with RELAP5. Seems like it's because of the extra argument of 'stdout' to subprocess.Popen(). As a work around, I explicitly use subprocess.Popen() in the plugin to run the executable.
    • This version of RELAP5-3D does not generate a CSV file. Instead, it generates a text file with a specific formatting. The text file needs to be converted to csv before the results can be extracted by the plugin. Other (newer) versions of RELAP5-3D is able to generate output csv files directly. The text-to-csv conversion in the plugin may need to be updated or removed in the future.
    • I also updated the documentation, added an example, and updated the test case for the new plugin.
    opened by zhieejhia93 9
  • Generalize the template-based plugin to be used with arbitrary executables

    Generalize the template-based plugin to be used with arbitrary executables

    This PR generalizes the TemplatePlugin class (now called PluginGeneric) such that you can use it to build a plugin for an arbitrary code by specifying the executable and command-line arguments. This changes the structure of the other classes such that they don't need to define the execute_command property, instead passing it directly to the __init__ method of PluginGeneric.

    With this new functionality, I've also expanded on our documentation to include:

    • A section in the developer's guide that discusses how to build a new plugin (closes #65)
    • A very simple "hello world" example in the getting started section (closes #62)

    @nstauff I'd appreciate if you could test this out on the various examples (PyARC, SAM, SAS, etc.) to make sure they still function as intended.

    opened by paulromano 8
  • Allow executable to be specified when creating plugins

    Allow executable to be specified when creating plugins

    This PR adds an executable argument to the constructor of all our plugins so that a user can specify an executable at the time the plugin is created. @nstauff ran into an issue where PluginSerpent was complaining that the sss2 executable wasn't found, and the only way to fix it was to make sure that sss2 was found via the PATH environment variable. With this change, one can either 1) explicitly give the absolute path of the executable or 2) give the name of the executable and specify an associated environment variable (e.g., SERPENT_DIR). I'll note that the way the executable is handled is now must more consistent across the different plugin classes.

    opened by paulromano 7
  • Plugin for Dakota

    Plugin for Dakota

    This PR creates a new plugin for Dakota:

    • The logic of the Dakota plugin is similar to the example provided by @nstauff . When Dakota is executed, it runs the Dakota_driver that in turn runs the coupled code (PyArc in the provided example) and facilitates the communication between Dakota and the coupled code.
    • The functionalities of the Dakota driver have been moved to a new class known as PluginDakotaDriver. The plugin still relies on Dakota's interfacing library to communicate between Dakota and the coupled code. However, it no longer relies on wasppy to provide input data to or extract results from Dakota.
    opened by zhieejhia93 6
  • Abce plugin

    Abce plugin

    This PR adds a watts plugin for ABCE. Closes #48. ABCE can be used to model the behavior of firms participating in electricity markets. Specifically, this PR

    • Adds a Plugin class, PluginABCE.
    • Adds a Results class, ResultsABCE.
    • Adds an example case and the configuration file in the examples directory.
    • Adds some documentation about ABCE and how to use the eponymous plugin with watts.

    At the moment, there are some issues on the ABCE end that prevent the addition of a more complete set of input files. Additionally, the example shown here will likely need to be reassessed as ABCE develops.

    opened by samgdotson 5
  • Extra templated input files

    Extra templated input files

    Some codes (such as SAS4A) may use templated files in both the main input file and the associated files. We need to provide the option for the user to expend templated supplementary files. Maybe this could be done with extra_inputs_tmpl that would contain the list of extra inputs that would need to be extended.

    opened by nstauff 5
  • Generalized MOOSE Plugin and Related Examples

    Generalized MOOSE Plugin and Related Examples

    This PR involves a series updates on MOOSE plugin:

    • A generalized MOOSE plugin is added to replace the original SAM specified plugin;
    • A simple BISON example is added in addition to the SAM example to demo the new generalized MOOSE plugin;
    • Add option to enable multi-processor running of MOOSE apps thru mpiexec -n n_cpu;
    • Add option to specify supplementary input files (e.g., exodus mesh file, sub-application input file, XS file, etc.) for MOOSE plugin;
    • Add a simple MOOSE MultiApps example.
    opened by miaoyinb 5
  • Avoid hanging by using non-blocking pipe

    Avoid hanging by using non-blocking pipe

    Some of have observed that WATTS will sometimes hang when writing output (#49). This PR should fix this by using a non-blocking pipe. However, this solution (and in fact our prior code) only works on Unix-based platforms. On Windows, we now revert to using normal subprocess.run instead of our special version. This means that, unfortunately, if you're on Windows, using the show_stdout and show_stderr arguments won't work (they rely on tee_stdout and tee_stderr which in turn implicitly rely on our implementation of run).

    I don't have WATTS installed anywhere on a Windows environment so I'm hoping someone can check whether this actually works there (@samgdotson?).

    opened by paulromano 4
  • Move more functionality into base Plugin and TemplatePlugin classes

    Move more functionality into base Plugin and TemplatePlugin classes

    This PR is a continuation of #42 and makes the following changes:

    • Each plugin now consistently uses an attribute .executable instead of different names (moose_exec, pyarc_exec, etc.). This makes it easier for the user, who only needs to learn one way of dealing with executables.
    • A lot of the run/postrun logic was consolidated into the TemplatePlugin class. In simple cases, a new plugin only needs to define an execute_command property and the TemplatePlugin.run method should work seamlessly.

    @nstauff I'd appreciate if you could try this out with some of the non-OpenMC plugins that are not currently tested in CI. I tried out the PyARC and SAS examples and they seem to work but it would be good to test the others as well.

    opened by paulromano 4
  • OpenMC required for tests

    OpenMC required for tests

    I'm over from JOSS looking at this repo to make sure everything checks out. I've looked over the docs quickly and everything looks really clean and understandable. I need to get the tests running on my laptop and I'm running into some issues that I'm hoping to get help with.

    I've installed watts from source, and when I run pytest tests I get the following (relevant snippet):

    ImportError while importing test module '/tmp/watts/tests/test_plugin_openmc.py'.
    Hint: make sure your test modules/packages have valid Python names.
    Traceback:
    /usr/lib/python3.8/importlib/__init__.py:127: in import_module
        return _bootstrap._gcd_import(name[level:], package, level)
    tests/test_plugin_openmc.py:7: in <module>
        import openmc
    E   ModuleNotFoundError: No module named 'openmc'
    

    I'm using conda, so I followed the install instructions here https://docs.openmc.org/en/stable/quickinstall.html and installed from mamba, and even still I get the same error. I've checked with python3 -c "import openmc; print(openmc.__version__)" to confirm that openmc is indeed installed. Any advice on this is much appreciated.

    Linking [https://github.com/openjournals/joss-reviews/issues/4735]

    opened by yadudoc 3
  • NEAMS Workbench

    NEAMS Workbench

    Description

    This MR allows WATTS to be run with NEAMS Workbench

    Fixes # (84)

    Checklist:

    • [x ] My code follows the style guidelines
    • [x ] I have performed a self-review of my own code
    • [x ] I have made corresponding changes to the documentation (if applicable)
    • [x ] I have added tests that prove my fix is effective or that my feature works (if applicable)
    • [x ] I have updated the CHANGELOG.md file (if applicable)
    • [x ] I have successfully run examples that may be affected by my changes
    opened by zhieejhia93 0
  • ACCERT plugin

    ACCERT plugin

    Description

    Add ACCERT plugin and include one example of ACCERT in example folder

    Fixes #27

    Checklist:

    • [x] My code follows the style guidelines
    • [x] I have performed a self-review of my own code
    • [ ] I have made corresponding changes to the documentation (if applicable)
    • [ ] I have added tests that prove my fix is effective or that my feature works (if applicable)
    • [ ] I have updated the CHANGELOG.md file (if applicable)
    • [ ] I have successfully run examples that may be affected by my changes
    opened by JiaZhou-PU 5
  • Control over temporary execution directory

    Control over temporary execution directory

    When a plugin is executed, it runs in a temporary directory that the user is generally unaware of. In some cases, it would be desirable to explicitly specify a path where the execution happens. Right now, the only control that one has is that you can change the TMPDIR environment variable, which will give a different base directory for where temporary files/directories are created.

    opened by paulromano 0
  • Improve data extraction in the RELAP5 plugin

    Improve data extraction in the RELAP5 plugin

    Currently the RELAP5 plugin converts the plotfl text file into a CSV file and stores the selected data. This process could be problematic for large cases as the conversion process is time and memory consuming.

    With the improvement, the plotfl file will no longer need to be converted to CSV. Instead, it will be read directly using PyPost which is a Python library from SNAP that can directly read the plotfl file. The new approach is significantly more efficient and is particularly suitable for large simulation cases.

    Given that access to SNAP is restricted, the current plotfl-to-CSV conversion approach will NOT be removed for users without access to SNAP (or PyPost).

    enhancement 
    opened by zhieejhia93 0
  • watts is not OS independent

    watts is not OS independent

    Currently, the setup.cfg file specifies watts as "OS Independent." However, there are at least two issues preventing Windows from supporting watts:

    1. The select.select([p.stdout, p.stderr]) call breaks because select.select cannot work with streams on windows. The workaround for this is a non-blocking pipe which is addressed by @paulromano branch nonblocking-pipe (which was originally motivated by #49).
    2. The fcntl is not supported by windows. There may be some substitutes. This appears integral to @paulromano's aforementioned non-blocking pipe.

    This issue can be closed when the developers decide to either

    • [ ] add support for windows machines
    • [ ] indicate which operating systems are required
    opened by samgdotson 2
Releases(v0.4.0)
Synchrosqueezing, wavelet transforms, and time-frequency analysis in Python

Synchrosqueezing is a powerful reassignment method that focuses time-frequency representations, and allows extraction of instantaneous amplitudes and frequencies

John Muradeli 382 Jan 06, 2023
A bash-like intrepreted language

A Bash-like interpreted scripting language.

AshVXmc 1 Oct 28, 2021
Dockernized ZeroTierOne controller with zero-ui web interface.

docker-zerotier-controller Dockernized ZeroTierOne controller with zero-ui web interface. 中文讨论 Customize ZeroTierOne's controller planets Modify patch

sbilly 209 Jan 04, 2023
Parser for the GeoSuite[tm] PRV export format

Parser for the GeoSuite[tm] PRV export format This library provides functionality to parse geotechnical investigation data in .prv files generated by

EMerald Geomodelling 1 Dec 17, 2021
PyCASCLib: CASC interface for Warcraft III

PyCASCLib CASC interface for Warcraft III. This repo provides bindings for JCASC: https://github.com/DrSuperGood/JCASC Installation Jdk is required fo

2 Jun 04, 2022
Run python scripts and pass data between multiple python and node processes using this npm module

Run python scripts and pass data between multiple python and node processes using this npm module. process-communication has a event based architecture for interacting with python data and errors ins

Tyler Laceby 2 Aug 06, 2021
Module for working with the site dnevnik.ru with python

dnevnikru Module for working with the site dnevnik.ru with python Dnevnik object accepts login and password from the dnevnik.ru account Methods: homew

Aleksandr 21 Nov 21, 2022
NasaApod - Astronomy Picture of the Day

Astronomy Picture of the Day Get interesting Astronomical pictures with a brief

Shripad Rao 1 Feb 15, 2022
A example project's description is a high-level overview of why you’re doing a project.

A example project's description is a high-level overview of why you’re doing a project.

Nikita Matyukhin 12 Mar 23, 2022
Python language from the beginning.

Python For Beginners Python Programming Language ♦️ Python is a very powerful and user friendly programming language. ❄️ ♦️ There are some basic sytax

Randula Yashasmith Mawaththa 6 Sep 18, 2022
Auto Join Zoom Meeting

Auto-Join-Zoom-Meeting Join a zoom meeting with out filling in meeting id's or passcodes, one button for it all! Setup See attached excel document. MA

JareBear 1 Jan 25, 2022
python3 scrip for case conversion of source code files writen in fixed form fortran

convert_FORTRAN_case python3 scrip for case conversion of source code files writen in fixed form fortran python3 scrip for case conversion of source c

7 Sep 20, 2022
A simple package for interacting with the 9kw.eu anti-captcha service.

Welcome to captcha9kw’s documentation! captcha9kw is a smallish Python package for making use of the 9kw.eu services, including solving of interactive

2 Feb 26, 2022
Strong Typing in Python with Decorators

typy Strong Typing in Python with Decorators Description This light-weight library provides decorators that can be used to implement strongly-typed be

Ekin 0 Feb 06, 2022
Provide error messages for Python exceptions, even if the original message is empty

errortext is a Python package to provide error messages for Python exceptions, even if the original message is empty.

Thomas Aglassinger 0 Dec 07, 2021
The Zig programming language, packaged for PyPI

Zig PyPI distribution This repository contains the script used to repackage the releases of the Zig programming language as Python binary wheels. This

Zig Programming Language 100 Nov 04, 2022
Basit bir cc generator'ü.

Basit bir cc generator'ü. Setup What To Do; Python Installation We install python from CLICK Generator Board After installing the file and python, we

Lâving 7 Jan 09, 2022
OpenSea NFT API App using Python and Streamlit

opensea-nft-api-tutorial OpenSea NFT API App using Python and Streamlit Tutorial Video Walkthrough https://www.youtube.com/watch?v=49SupvcFC1M Instruc

64 Oct 28, 2022
Awesome & interesting talks about programming

Programming Talks I watch a lot of talks that I love to share with my friends, fellows and coworkers. As I consider all GitHubbers my friends (oh yeah

Veit Heller 7k Dec 26, 2022
Comics/doujinshi reader application. Web-based, will work on desktop and tablet devices with swipe interface.

Yomiko Comics/doujinshi reader application. Web-based, will work on desktop and tablet devices with swipe interface. Scans one or more directories of

Kyubi Systems 26 Aug 10, 2022