Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

export classes inside of the CO2 class #220

Merged
merged 1 commit into from
Jul 31, 2024
Merged

Conversation

fershad
Copy link
Contributor

@fershad fershad commented Jul 11, 2024

Triage

Type of change

Please select any of the below items that are appropriate.

This pull request:

  • Adds a new carbon estimation model to CO2.js
  • Adds new functionality to an existing model
  • Fixes a bug with an existing model implementation
  • Add other new functionality to CO2.js
  • Add new data to CO2.js
  • Improves developer experience for contributors
  • Adds contributors to CO2.js
  • Does something not specified above

Related issue/s

Please list below any issues this pull request is related to.

Docs changes required

Do any changes made in this pull request require parts of the CO2.js documentation to be updated?

  • Yes
  • No
  • I don't know

It has been decided that at this time, this change will not be documented.

If you answered "Yes", please create an corresponding issue in our Developer Documentation repository.

Describe the changes made in this pull request

As clearly as possible, describe the changes made in the pull request. You should at least detail "what changes have been made" and "what the results of these changes will be".

This change exposes all private functions and variables that are available in the OneByte and Sustainable Web Design Model classes that are used in CO2.js. The change would allow developers to access energy estimation functions, embodied and operational emissions estimation functions, and other constants that are included in those classes.

As a result of this change, developers can access these functions as below:

import {co2} from "@tgwf/co2";
let swdmv3 =  new co2().SustainableWebDesignV3();

// Access the Sustainable Web Design Model directly.
const operationalEnergy = swdmv3.operationalEnergyPerSegment(1000);
console.log(operationalEnergy);

// Access the Sustainable Web Design Model via CO2.js API (perByte/perVisit functions)
const emissions = new co2();
const estimate = emissions.perByte(1000)

@fershad
Copy link
Contributor Author

fershad commented Jul 29, 2024

@mrchrisadams I feel that this PR is ready for a brief review.

@mrchrisadams
Copy link
Member

Hi Fish! This looks good, thanks! Merge away :)

@fershad fershad merged commit 4541319 into main Jul 31, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants