Coder Social home page Coder Social logo

manjavacas / melkit Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 1.0 7.26 MB

A MELCOR file manipulation toolkit.

Home Page: https://melkit.readthedocs.io/

License: GNU General Public License v3.0

Makefile 1.35% Python 98.65%
melcor melcor-fusion melgen toolkit

melkit's Introduction

drawing

Release License Contributors

A multi-purpose Python toolkit designed to easily edit and query MELCOR 1.8.6 files.

⚙️ Utilities

  • Control Volumes (CVs), Flow Paths (FLs) and Control Functions (CFs) querying and modification.
  • PTF and EDF visualization tools.
  • Extraction of CVs and FL connections for a given CV.
  • Extraction of CFs associated with a given FL, including recursive extraction of inter-dependent CFs.
  • Auxiliary tools (comments deletion, duplicates checking...).
  • And more!

▶️ Installation

Install MELKIT via PyPI:

pip install melkit

💻 How to use

The Toolkit class is all you need to start working with MELKIT.

from melkit.toolkit import Toolkit

toolkit = Toolkit('file.inp')

cvs = toolkit.read_cvs()
fls = toolkit.read_fls()

Check out the project documentation for additional usage examples.

📦 Extensions

The MELCOR Language Support (MLS) is a MELCOR 1.8.6 syntax highlighter for Visual Studio Code.

It is publicly available at VS Marketplace. Just search for MLS or download it from here.

👐 Contributing

Feel free to contribute via issues and pull requests. See CONTRIBUTING.

📃 License

See LICENSE.

melkit's People

Contributors

manjavacas avatar rzehumat avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

rzehumat

melkit's Issues

[FEATURE] General improvements

The following tasks are planned for an upcoming version:

  • Improved README with additional information and up-to-date description of the project.
  • New templates for issues and pull requests.
  • Marketplace availability for MLS.
  • Documentation update.
  • Additional minor changes.

Together with latest Toolkit improvements, this major update will improve the maturity of the project, thus enabling further contributions in a standarized way.

Possibly duplicit projects

Hi,

note: this is not meant to be any discouragement from the project -- I'm rather wondering how to do stuff efficiently.

I was wondering what is worth inventing VS. what is worth taking from somewhere else VS. what is not worth inventing at all.
In particular, how to avoid the famous 14 competing standards issue, since there are many similar projects around

Although some of them seems discontinued...
Any thoughts about that? Not sure if you're actually implementing something similar to these or something completely different (I did not dig into the code that much yet...).

[FEATURE] Include PTF/EDF handling methods for data visualization

In order to facilitate the manipulation of simulation results 📈 , it is proposed to implement methods aimed at:

  • Visualize data in a similar way to external programs such as AptPlot, allowing a more flexible and automated configuration.
  • Automatic generation of plots, reports, etc.
  • Extraction, summary and visualization of different stats.

Management of PTF files

Hi,
this looks like a very promising package, thanks for doing this.

Have you considered adding tools for management of PTF files?

There exist couple of them already (e.g. the one by mattdon) plus I've used that one for minimalistic script for automated plotting and export to pd.DataFrame, so I was thinking if it would be worth merging here (I'll add pull-request soon).

[BUG]: PTF errors and improvements

Issue description

Documentation compiling errors are happening due to ptf_example.py.

Additional context

Since MELKIT documentation was not properly compiling, I checked that the following error related to the new ptf_example.py was happening:

* AttributeError: module 'melkit' has no attribute 'ptf'
* TypeError: 'type' object is not subscriptable

Proposed solution

Despite I approved this new feature through #7, several changes need to be done:

  • I recommend to re-write ptf.py with a single class PTF without external methods. Take class toolkit.Toolkit as a reference.
  • Adapt code documentation to the same style of toolkit.py (please, use typing).
  • Rewrite the documentation example, ensuring that it works.

May you fix it @rzehumat ?

[FEATURE] Merge MELTOOLS

I think I could do it, but can't promise when.

  • check for useful modules in meltools
  • merge the useful ones into this project
    • code should be ready, just fix pep8
    • add examples
    • add documentation

[FEATURE] Basic operations

The first version of MELKIT shall include the following basic functionalities, which can be extended upon request by the community:

  • Reading Control Volumes (CVs) and Flow Paths (FLs) and converting them to objects.
  • Writing, deleting and editing CVs and FLs.
  • Plotting files generated by the EDF package.
  • Extraction of final values for variables monitored by EDF.
  • Obtaining the list of available/used IDs for certain objects (CVs, FLs).
  • Remove all comments from an input file.
  • Search for objects by their ID.
  • Search for duplicate objects in a given list.
  • Get adjacent CVs and FL connections for a given CV.
  • Create a submodel from a given CV.
  • Basic PTF visualization.
  • Auxiliar tools for MELCOR input manipulation.

[FEATURE] Control Function support

It is proposed to implement support for control functions (CF), including:

  • Extracting CFs linked to flow paths.
  • CFs edition.

The next steps in the development of MELKIT will be focused on this feature.

[FEATURE]: Merge MELTOOLS

Feature description

There is a (now discontinued) project called MELTOOLS, related to a similar purpose as melkit. To avoid both re-inventing of the wheel and 15 standards problem, it might help to review features in meltools and merge the useful here.

Additional considerations

I've talked with the original developer of meltools and he supported the abovementioned idea.

Proposed solution

I think I could do it, but can't promise when.

  • check for useful modules in meltools
  • merge the useful ones into this project
    • code should be ready, just fix pep8 (and possibly some other code-style-related issues)
    • add examples
    • add documentation

[FEATURE] Allowing same-file object manipulation

Currently, all write, delete or edit operations on objects using Toolkit result in a new file (<filename>_NEW by default).

It is proposed that the generated file could have the same name as the original file. That is to say, that it is an edition of the original file.

A temporary file could be used as an intermediary:

  1. Read original input file.
  2. Copy it to temporary input.
  3. Delete original input file.
  4. Create new file as copy of temporary file (or rename it).

I will work on this in a future pull request.

[DOC] Add documentation hosted in GitHub pages

In order to facilitate the use of MELKIT, we intend to develop the documentation of the package using Sphinx and GitHub pages 📖

It will include:

  • What is MELKIT and how to use it (installation, getting started...).
  • Main uses and limitations.
  • Advanced usage examples.
  • Additional information
  • API documentation.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.