Move along, nothing to see here.
docker-compose up
The current directory will be mounted in the container, with the output being
written to out.jsonl
(line-separated json)
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 (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 overAbsurdPolynomialFitSource
Default pvsim source.
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
docker-compose up -d rabbitmq
./setup_virtualenv
. ./activate
python -m lutetium
Running tests:
python -m pytest
Random word generated by asd, which is what I use to avoid getting stuck thinking names for things.