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 dog facts python module

A dog facts python module

Fayas Noushad 3 Nov 28, 2021
Render to print for blender 2.9+

render_to_print_blender_addon ** render2print: Blender AddOn for Blender 2.90.0+ ** Calculates camera parameters to allow printing a rendered image to

5 Nov 19, 2021
Сервис служит прокси между cервисом регистрации ошибок платформы и системой сбора ошибок Sentry

Sentry Reg Service Сервис служит прокси между Cервисом регистрации ошибок платформы и системой сбора ошибок Sentry. Как развернуть Sentry onpremise. С

Ingvar Vilkman 13 May 24, 2022
PIP Manager written in python Tkinter

PIP Manager About PIP Manager is designed to make Python Package handling easier by just a click of a button!! Available Features Installing packages

Will Payne 9 Dec 09, 2022
Gitlab py scripts

Gitlab py scripts The code can be used to gather the list of GitHub groups/projects and the permissions of the users in those groups/projects. group/p

Roghuchi 1 Aug 29, 2022
Powerful Assistant

Delta-Assistant Hi I'm Phoenix This project is a smart assistant This is the 1.0 version of this project I am currently working on the third version o

1 Nov 17, 2021
Ml-design-patterns - Source code accompanying O'Reilly book: Machine Learning Design Patterns

This is not an official Google product ml-design-patterns Source code accompanying O'Reilly book: Title: Machine Learning Design Patterns Authors: Val

Google Cloud Platform 1.5k Jan 05, 2023
Dotfiles for my configurations!

Dotfiles Repo Welcome! Over here, you can find my dotfiles for various applications, including QTile, Alacritty, Kitty, LunarVim, and more! Make sure

class PythonAddict 3 Jan 10, 2022
Automation in socks label validation

This is a project for socks card label validation where the socks card is validated comparing with the correct socks card whose coordinates are stored in the database. When the test socks card is com

1 Jan 19, 2022
Tc-python - A Python script to receive message from a twitch chat

Twitch-Chat 📜 I did a script in Python to receive messages from a twitch chat.

miyucode 2 May 31, 2022
Bazel rules to install Python dependencies with Poetry

rules_python_poetry Bazel rules to install Python dependencies from a Poetry project. Works with native Python rules for Bazel. Getting started Add th

Martin Liu 7 Dec 15, 2021
Streamlit apps done following data professor's course on YouTube

streamlit-twelve-apps Streamlit apps done following data professor's course on YouTube Español Curso de apps de data science hecho por Data Professor

Federico Bravin 1 Jan 10, 2022
We are building an open database of COVID-19 cases with chest X-ray or CT images.

🛑 Note: please do not claim diagnostic performance of a model without a clinical study! This is not a kaggle competition dataset. Please read this pa

Joseph Paul Cohen 2.9k Dec 30, 2022
An experimental Python-to-C transpiler and domain specific language for embedded high-performance computing

An experimental Python-to-C transpiler and domain specific language for embedded high-performance computing

Andrea Zanelli 562 Dec 28, 2022
Collapse a set of redundant kmers to use IUPAC degenerate bases

kmer-collapse Collapse a set of redundant kmers to use IUPAC degenerate bases Overview Given an input set of kmers, find the smallest set of kmers tha

Alex Reynolds 3 Jan 06, 2022
A shim for the typeshed changes in mypy 0.900

types-all A shim for the typeshed changes in mypy 0.900 installation pip install types-all why --install-types is annoying, this installs all the thin

Anthony Sottile 28 Oct 20, 2022
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
Process RunGap output file of a workout and load data into Apple Numbers Spreadsheet and my website with API calls

BSD 3-Clause License Copyright (c) 2020, Mike Bromberek All rights reserved. ProcessWorkout Exercise data is exported in JSON format to iCloud using

Mike Bromberek 1 Jan 03, 2022
A python module for DeSo

DeSo.py A python package for DeSo. Developed by ItsAditya Run pip install deso to install the module! Examples of How To Use DeSo.py Getting $DeSo pri

ItsAditya 0 Jun 30, 2022
Sudoku-Solver

Sudoku-Solver This is a personal project, that put all my today knowledges to the test, is a project that im developing alone with a lot of effort and

Carlos Ismael Gitto Bernales 5 Nov 08, 2021