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

Miscellaneous watts
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)
Owner
null
A program that takes Python classes and turns them into CSS classes.

PyCSS What is it? PyCSS is a micro-framework to speed up the process of writing bulk CSS classes. How does it do it? With Python!!! First download the

T.R Batt 0 Aug 3, 2021
TB Set color display - Add-on for Blender to set multiple objects and material Display Color at once.

TB_Set_color_display Add-on for Blender with operations to transfer name between object, data, materials and action names Set groups of object's or ma

null 1 Jun 1, 2022
On this repo, you'll find every codes I made during my NSI classes (informatical courses)

??‍?? ??‍?? school-codes On this repo, you'll find every codes I made during my NSI classes (informatical courses) French for now since this repo is d

EDM 1.15 3 Dec 17, 2022
Python script to combine the statistical results of a TOPAS simulation that was split up into multiple batches.

topas-merge-simulations Python script to combine the statistical results of a TOPAS simulation that was split up into multiple batches At the top of t

Sebastian Schäfer 1 Aug 16, 2022
BloodCheck enables Red and Blue Teams to manage multiple Neo4j databases and run Cypher queries against a BloodHound dataset.

BloodCheck BloodCheck enables Red and Blue Teams to manage multiple Neo4j databases and run Cypher queries against a BloodHound dataset. Installation

Mr B0b 16 Nov 5, 2021
This repository provides a set of easy to understand and tested Python samples for using Acronis Cyber Platform API.

Base Acronis Cyber Platform API operations with Python !!! info Copyright © 2019-2021 Acronis International GmbH. This is distributed under MIT licens

Acronis International GmbH 3 Aug 11, 2022
tox-gh is a tox plugin which helps running tox on GitHub Actions with multiple different Python versions on multiple workers in parallel

tox-gh is a tox plugin which helps running tox on GitHub Actions with multiple different Python versions on multiple workers in parallel. This project is inspired by tox-travis.

tox development team 19 Dec 26, 2022
A collection of Workflows samples for various use cases

Workflows Samples Workflows allow you to orchestrate and automate Google Cloud and HTTP-based API services with serverless workflows.

Google Cloud Platform 76 Jan 7, 2023
Automation of VASP DFT workflows with ASE - application scripts

This repo contains a library that aims at automatizing some Density Functional Theory (DFT) workflows in VASP by using the ASE toolkit.

Frank Niessen 5 Sep 6, 2022
Vehicle Identification Speed Detection (VISD) extracts vehicle information like License Plate number, Manufacturer and colour from a video and provides this data in the form of a CSV file

Vehicle Identification Speed Detection (VISD) extracts vehicle information like License Plate number, Manufacturer and colour from a video and provides this data in the form of a CSV file. VISD can also perform vehicle speed detection on a video. All these features of VSID are provided to the user using a Web Application which is created using Flask

null 6 Feb 22, 2022
A little tool that uses LLVM to extract simple "what does this do" level instruction information from all architectures.

moirai: MOre InstRuctions and Information Backcronym. Anyway, this is a small project to extract useful instruction definitions from LLVM's platform d

null 2 Jul 30, 2022
LSO, also known as Linux Swap Operator, is a software with both GUI and terminal versions that you can manage the Swap area for Linux operating systems.

LSO - Linux Swap Operator Türkçe - LSO Nedir? LSO, diğer adıyla Linux Swap Operator Linux işletim sistemleri için Swap alanını yönetebileceğiniz hem G

Eren İnce 4 Feb 9, 2022
A module that can manage you're gtps

Growtopia Private Server Controler Module For Controle Your GTPS | Build in Python3 Creator Information

iFanpS 6 Jan 14, 2022
Izy - Python functions and classes that make python even easier than it is

izy Python functions and classes that make it even easier! You will wonder why t

null 5 Jul 4, 2022
Macros in Python: quasiquotes, case classes, LINQ and more!

MacroPy3 1.1.0b2 MacroPy is an implementation of Syntactic Macros in the Python Programming Language. MacroPy provides a mechanism for user-defined fu

Li Haoyi 3.2k Jan 6, 2023
Python Classes Without Boilerplate

attrs is the Python package that will bring back the joy of writing classes by relieving you from the drudgery of implementing object protocols (aka d

The attrs Cabal 4.6k Jan 2, 2023
Simple but maybe too simple config management through python data classes. We use it for machine learning.

??‍✈️ Coqpit Simple, light-weight and no dependency config handling through python data classes with to/from JSON serialization/deserialization. Curre

coqui 67 Nov 29, 2022
Python Interactive Graphical System made during Computer Graphics classes (INE5420-2021.1)

PY-IGS - The PYthon Interactive Graphical System The PY-IGS Installation To install this software you will need these dependencies (with their thevelo

Enzo Coelho Albornoz 4 Dec 3, 2021
This is a backport of the BaseExceptionGroup and ExceptionGroup classes from Python 3.11.

This is a backport of the BaseExceptionGroup and ExceptionGroup classes from Python 3.11. It contains the following: The exceptiongroup.BaseExceptionG

Alex Grönholm 19 Dec 15, 2022