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)
A script to generate NFT art living on the Solana blockchain.

NFT Generator This script generates NFT art based on its desired traits with their specific rarities. It has been used to generate the full collection

Rude Golems 24 Oct 08, 2022
A curated collection of Amazing Python scripts from Basics to Advance with automation task scripts

📑 Introduction A curated collection of Amazing Python scripts from Basics to Advance with automation task scripts. This is your Personal space to fin

Amitesh kumar mishra 1 Jan 22, 2022
Leveraging pythonic forces to defeat different coding challenges 🐍

Pyforces Leveraging pythonic forces to defeat different coding challenges! Table of Contents Pyforces Tests Pyforces Pyforces is a study repo with a c

Igor Grillo Peternella 8 Dec 14, 2022
PyPI package for scaffolding out code for decision tree models that can learn to find relationships between the attributes of an object.

Decision Tree Writer This package allows you to train a binary classification decision tree on a list of labeled dictionaries or class instances, and

2 Apr 23, 2022
A reference implementation for processing the content.log files found at opendata.dwd.de/weather

A reference implementation for processing the content.log files found at opendata.dwd.de/weather.

Deutscher Wetterdienst (DWD) 6 Nov 26, 2022
An early stage integration of Hotwire Turbo with Django

Note: This is not ready for production. APIs likely to change dramatically. Please drop by our Slack channel to discuss!

Hotwire for Django 352 Jan 06, 2023
Python implementation of the Learning Time-Series Shapelets method, that learns a shapelet-based time-series classifier with gradient descent.

shaplets Python implementation of the Learning Time-Series Shapelets method by Josif Grabocka et al., that learns a shapelet-based time-series classif

Mohamed Haseeb 187 Dec 14, 2022
Audio-analytics for music-producers! Automate tedious tasks such as musical scale detection, BPM rate classification and audio file conversion.

Click here to be re-directed to the Beat Inspect Streamlit Web-App You are a music producer? Let's get in touch via LinkedIn Fundamental Analytics for

Stefan Rummer 11 Dec 27, 2022
Fork of pathlib aiming to support the full stdlib Python API.

pathlib2 Fork of pathlib aiming to support the full stdlib Python API. The old pathlib module on bitbucket is in bugfix-only mode. The goal of pathlib

Jazzband 73 Dec 23, 2022
A script to add issues to a project in Github based on label or status.

Add Github Issues to Project (Beta) A python script to move Github issues to a next-gen (beta) Github Project Getting Started These instructions will

Kate Donaldson 3 Jan 16, 2022
Rofi script to minimize / unminimize multiple windows in qtile

Qminimize Rofi script to minimize / unminimize multiple windows in qtile Additional requirements : EWMH module fuzzywuzzy module How to use it : - Clo

9 Sep 18, 2022
tool to automate exploitation of android degubg bridge vulnerability

DISCLAIMER DISCLAIMER: ANY MALICIOUS USE OF THE CONTENTS FROM THIS ARTICLE WILL NOT HOLD THE AUTHOR RESPONSIBLE HE CONTENTS ARE SOLELY FOR EDUCATIONAL

6 Feb 12, 2022
A program made in PYTHON🐍 that automatically performs data insertions into a POSTGRES database 🐘 , using as base a .CSV file 📁 , useful in mass data insertions

A program made in PYTHON🐍 that automatically performs data insertions into a POSTGRES database 🐘 , using as base a .CSV file 📁 , useful in mass data insertions.

Davi Galdino 1 Oct 17, 2022
An interactive tool with which to explore the possible imaging performance of candidate ngEHT architectures.

ngEHTexplorer An interactive tool with which to explore the possible imaging performance of candidate ngEHT architectures. Welcome! ngEHTexplorer is a

Avery Broderick 7 Jan 28, 2022
8 Nov 04, 2022
A tool to flash .ofp files in bootloader mode without needing MSM Tool, an alternative to official realme tool

Oppo/Realme Flash .OFP File on Bootloader A tool to flash .ofp files in bootloader mode without needing MSM Tool, an alternative to official realme to

Italo Almeida 70 Jan 02, 2023
A web interface for a soft serve Git server.

Soft Serve monitor Soft Sevre is a very nice git server. It offers a really nice TUI to browse the repositories on the server. Unfortunately, it does

Maxime Bouillot 5 Apr 26, 2022
Sardana integration into the Jupyter ecosystem.

sardana-jupyter Sardana integration into the Jupyter ecosystem.

Marc Espín 1 Dec 23, 2021
Magenta: Music and Art Generation with Machine Intelligence

Magenta is a research project exploring the role of machine learning in the process of creating art and music. Primarily this involves developing new

Magenta 18.1k Jan 05, 2023
It is convenient to quickly import Python packages from the network.

It is convenient to quickly import Python packages from the network.

zmaplex 1 Jan 18, 2022