https://github.com/dequis/lutetium
move along nothing to see here
https://github.com/dequis/lutetium
Last synced: 3 months ago
JSON representation
move along nothing to see here
- Host: GitHub
- URL: https://github.com/dequis/lutetium
- Owner: dequis
- Created: 2018-08-19T20:51:13.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-08-21T07:33:51.000Z (almost 7 years ago)
- Last Synced: 2025-03-07T03:30:55.759Z (3 months ago)
- Language: Python
- Size: 25.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# lutetium
Move along, nothing to see here.
## Installation and usage
docker-compose up
The current directory will be mounted in the container, with the output being
written to `out.jsonl` (line-separated json)### Alternate deployment modes
The default commandline is the following:
python -m lutetium -vv all
This runs the `all` task set with debug-level verbosity. This is equivalent to:
python -m lutetium -vv meter pvsim writer
All three tasks can be run individually in separate processes, if desired.
Other options:
Options:
-v, --verbose
-f, --filename TEXT
--meter-source [random|absurd_polynomial|noisy_absurd_polynomial]
--pvsim-source [random|absurd_polynomial|noisy_absurd_polynomial]
--help Show this message and exit.`-f` changes the output filename (default `out.jsonl`)
`--meter-source` and `--pvsim-source` change the data sources for each of those
components. Available sources:* `random`: A meter source that targets random values and moves 10%-30% of the
way in each stepDefault meter source.
* `absurd_polynomial`: A PV data source that pretends this is a data science
problem.Uses data extracted from the PDF using [WebPlotDigitizer][1] (data set
available at `data/pv_curve_pdf.json`), then fits that data into a cubic
polynomial using numpy, excluding source data points under a threshold of
y=0.1 so the curve doesn't have to deal with the flat night portion. Then,
when evaluating the polynomial, it uses max(0, x) to skip the negative part
of the resulting curve.To avoid the numpy dependency at runtime, the generated polynomial is just
a constant and evaluated with a list comprehension. The code to generate it
is available below, but not executed.* `noisy_absurd_polynomial`: Adds a bit of random noise over
`AbsurdPolynomialFitSource`Default pvsim source.
### RabbitMQ configuration
The RabbitMQ connection can be configured through the `LUTETIUM_AMQP_CONFIG`
environment variable. It should be a JSON object, which for the defaults would
be `{"host": "127.0.0.1", "port": 5672}`Available keys, from the aioamqp config:
> * host (str) – the host to connect to
> * port (int) – broker port
> * login (str) – login
> * password (str) – password
> * virtualhost (str) – AMQP virtualhost to use for this connection
> * ssl (bool) – create an SSL connection instead of a plain unencrypted one
> * verify_ssl (bool) – verify server’s SSL certificate (True by default)
> * login_method (str) – AMQP auth method## Development usage with virtualenv
docker-compose up -d rabbitmq
./setup_virtualenv
. ./activate
python -m lutetiumRunning tests:
python -m pytest
## What's the name?
Random word generated by [asd][2], which is what I use to avoid getting stuck
thinking names for things.[1]: https://apps.automeris.io/wpd/
[2]: https://github.com/dequis/dotfiles/blob/master/bin/asd