ttitcombe / greta Goto Github PK
View Code? Open in Web Editor NEWPython library for Green Computing - uses carbon intensity APIs to make code execution low-carbon
License: GNU General Public License v3.0
Python library for Green Computing - uses carbon intensity APIs to make code execution low-carbon
License: GNU General Public License v3.0
Use GitHub pipelines to test code quality (black, isort, mypy) and run unit tests
To minimise carbon costs, a codebase should not make unnecessary API calls.
Results from API calls should be cached and subsequent calls should instead use the cached values if an unsufficient amount of time has passed for the carbon intensity to have meaninfully changed. A naive value would be ~10 minutes. Later tasks should focus on making this more intelligent.
A user should be able to specify a more specific location within the UK to check carbon intensity.
The carbon intensity APi provides intensity values for regions of the UK. Update the intensity fetching function to take an optional argument denoting region. If present, compare to the regional intensity instead of national.
Create a decorator which causes a function to skip execution if intensity is higher than a given threshold
This would be a useful feature if an application contained useful but not necessary functionality. For example, regular scraping of a database or API: if intensity is high you could afford to skip that functionality for a while
Create unit tests in PyTest for existing functionality
We use "responses" library to mock-out API calls. Currently this requires a @responses.active
wrapper on every test function and a responses data setup.
Find a way to simplify this for test files so responses code does not need to be written so much
Currently a failed API call will produce unhandled errors. This should be handled by Greta and the user should be able to decide what to do in this scenario. A choice of do/do not run if API call fails.
For this task, treat all failures together (i.e. do not differentiate 4xx and 5xx subtypes). Add a parameter to checks functions to change this behaviour and give it a sensible default (with argument why that should be default behaviour - I've not made up my mind which way!)
A variable value should be conditional on the carbon intensity at runtime.
If intensity is below a threshold set one value; set another value if it's above.
This may come in use for code with timeouts or loops. Functions can now run for less time High intensity periods
As someone trying to develop green software, I want to know the carbon costs of my software running.
Create functions to wrap or otherwise augment logging
capability to log the carbon intensity at runtime (start and end).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.