semvec/pypi-packages huggingface dataset:
formenergy-tpv-parsing 0.0.1
Parsing and generation tools for test scripts/protocols.
Requires Python: >=3.8

# Form Energy Test Protocol Parsing and Generation

This repo defines a structued, internal format for test scripts (aka TPV aka test protocols), in `test_protocol.proto` using [Google Protobuf](https://protobuf.dev/overview/).

The `formenergy_tpv_parsing` Python module contains submodules to:
*   Parse Arbin Schedule `.sdx` format into this internal format (`sdx_format.parse(filename)`).
*   Parse and evaluate expressions for limits, variable assignments, and functions, using a limited subset of Python syntax, to allow simulating and summarizing test scripts (`expression_parsing.Parser.evaluate(expr)`).
*   Summarize test script contents and logic (`fact_sheet.build_fact_sheet(parsed_tpv)`).

Actual test script data is stored separately.

## Release Notes

This is published to Form's internal PyPI [using flit similar to formenergy-observability](https://wiki.formenergy.com/display/BD/formenergy-observability+Documentation).

*   0.0.1 Initial proof of concept.

## Development

### Setup

Create and activate a virtual environment with your favorite tool, such as [direnv](https://github.com/direnv/direnv/wiki/Python). This project requires Python 3.8.

There is a `Makefile` with typical setup commands.

```bash
# Install the Python package and pre-commit hooks.
make setup
```

By default, `flit` installs into the current virtual environment. Using the `--python` argument can let you install into a specific venv other than the currently active one. For example you can activate some other venv, run `which python`, and then pass the output of that command to `flit`'s `--python` argument when installing from the `form-observability` repo.

```bash
# Install the proto compiler system-wide. Choose depending on platform:
make protoc-mac
make protoc-linux
```

### Run

Check out a copy of [test-protocols](https://bitbucket.org/formenergy/test-protocols). Then you can run the parsing code in this repository against the Arbin `.sdx` files.

```bash
./parse_sdx.py <TEST_PROTOCOLS_PATH>
```