Open tomharvey opened 4 years ago
This is something we can think about while we use this package in more practical applications. At the moment, I don't see the need for writing a custom settlement period object for each different length/time. I think that we could create a base/general SettlementPeriod
object or object factory, as we can make everything depend on just the freq_minutes
and timezone
parameters at instantiation.
There is an implementation of a settlement period in the Australian NEM (National Energy Market) which is a 30 minute long settlement period, using the AEST timezone.
There are countless settlement periods in various markets around the globe - can you add to the list of supported regions.
To implement a new settlement period you should create a class which inherits from the
BaseSettlementPeriod
class, and implement 3 core methods:time_zone
static method which returns thepytz
timezone which the energy market operates infreq_minutes
property which is the length of the settlement period, in minutes.start
- these settlement periods are instantiated by a moment in time, this function should take that moment in time and return adatetime
object for the start of that period.See the NemSettlementPeriod implementation for more guide on how to create new implementations.
Pay particular attention to writing tests for your settlement period's start method, and have fun.