Skip to content

Latest commit

 

History

History
161 lines (113 loc) · 5.44 KB

README.md

File metadata and controls

161 lines (113 loc) · 5.44 KB

Contributors Forks Stargazers Issues Apache-2 License


Pywr-schema

A schema and JSON validator for Pywr.

Report Bug · Request Feature

Table of Contents
  1. About
  2. Getting Started
  3. Roadmap
  4. Contributing
  5. License
  6. Contact
  7. Acknowledgments

About The Project

Pywr is a water resources modelling library. It uses a JSON file format for model definition. Unfortunately it contains no strong schema definition and uses bespoke deserialization methods. This makes parsing model definitions in other tools difficult.

Several attempts have been made to add and strengthen the schema definition in Pywr itself, but these have become difficult to implement due to backward compatibility reasons. Therefore, this project has been created as a separate definition of the Pywr JSON schema. It is implemented in Rust using serde and serde_json. It aims to achieve schema compatibility with the latest version of Pywr while also supporting custom nodes and parameters.

The package is split into a library, pywr_schema, and validator pywr_validator. Other tools may make use of the library for parsing Pywr JSON.

(back to top)

Getting Started

Pywr-schema is built with Rust and requires a working installation. To validate a Pywr JSON file run the pywr_validator as follows.

git clone https://github.com/pywr/pywr-schema.git
cd pywr-schema
cargo r --bin pywr_validator -- --path /path/to/my-model.json

(back to top)

Roadmap

  • Initial support for nodes.
  • Initial support for parameters.
  • Initial support for recorders.
  • Schema definitions for all nodes.
  • Schema definitions for all parameters.
  • Schema definitions for all recorders.
  • Python support.

See the open issues for a full list of proposed features (and known issues).

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the Apache-2 License. See LICENSE.txt for more information.

(back to top)

Contact

Project Link: https://github.com/pywr/pywr-schema

(back to top)