Comments (7)
Good thoughts! One complication I can think of is that different companies have different cutoffs for their usage tiers. Some use 1000kWh, 1250kWh, others 1500kWh. And they keep changing it. We could parameterize that, but then I could imagine the retailer adding an additional tier.
The main reason I made the logic of the existing functions really simple is to learn and classify different kinds of plans before coming up with a generic model. The retailers' goal is to make coming up with this generic model very difficult if not impossible
from powertochoose.
I agree that it is complicated, that is why I thought the tier's would be set for each one, so maybe the class could have any number of tiers/rates? This is already defined to allow for different cutoffs for each one, so even with the TDU class defined as above, we could have something like:
infuse3 = TDU('infuse_3', 'abc123-10abcd-ef', '10',
rate(500, '(.05)*(x-500)'),
rate(1500, '(.05)*(x-1500)'),
rate(2500, '(.10)*(x-2500)'))
infuse6 = TDU('infuse_6', 'abc123-10abcxxd-ef', '100',
rate(500, '(.05)*(x-500)'),
rate(1500, '(.07)*(x-1000)'),
rate(2500, '(.03)*(x-1900)'))
other_co_other_rate = TDU('other_co_other_rate', 'sss123-10abcd-ef', '200',
rate(999, '(.05)*(x)'),
rate(1400, '(.07)*(x-999)'),
rate(2000, '(.07)*(500) + (.03)*(x-1400)'))
from powertochoose.
I guess the class should include a url (to the fact sheet) and perhaps the company name separate. That way, it would be easier to pull out all the ones that belong in groups and produce usable data?
from powertochoose.
Sorry, you're right, I wasn't looking at that closely. What's the proper way for a plan with only two tiers?
from powertochoose.
I just made a PR with a setup classes. It would look like this:
example = Offer('example_name', 'utility', 'some tariff ref','url.com', '100',
[Tier(0, 'base'), # or 0, I'm not sure without rest of context, doubt "free"
Tier(1000, '100 + (.13)*(x-1000)')])
from powertochoose.
Same link from the PR for setup class, but I think it may help this discussion: This is a playground showing how the Offer class works. https://code.sololearn.com/cAo2FlACcLpq/#py
from powertochoose.
I'm closing this because there is a separate PR and discussion. That way, we can keep the discussion in one place.
from powertochoose.
Related Issues (8)
- Add readme.md
- Add contribution guide
- Have python script actually call all billing functions and return dictionaries of estimates HOT 2
- [Multiple PRs needed] Convert electricity usage plans to simple functions HOT 4
- Pull out TDU charges from every plan's calculation HOT 2
- Clean up spacing/formatting HOT 1
- Link to individual plan pages from corresponding methods' docstrings HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from powertochoose.