Skip to content

Add JSDoc comments to data generation scripts and output files#230

Merged
fershad merged 6 commits intothegreenwebfoundation:mainfrom
Malay-dev:js-doc-comments
Oct 23, 2024
Merged

Add JSDoc comments to data generation scripts and output files#230
fershad merged 6 commits intothegreenwebfoundation:mainfrom
Malay-dev:js-doc-comments

Conversation

@Malay-dev
Copy link
Contributor

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

Describe the changes made in this pull request

This pull request adds comprehensive JSDoc comments to the data generation scripts and the generated data files in CO2.js. The changes include:

  1. Updated generate_average_co2.js with detailed JSDoc comments explaining the purpose of the script, its inputs, outputs, and key functions.
  2. Updated generate_marginal_co2.js with similar JSDoc comments, providing clear documentation on the script's functionality and data processing.
  3. Added brief JSDoc comments to the minified data files (average-intensities.min.js and marginal-intensities-2021.min.js) to indicate their content and origin.

New files added

  • None

Dependencies added

  • None

New network requests

  • None

Additional context

These changes will significantly improve the developer experience for contributors by:

  1. Providing clear documentation on the purpose and functionality of each script and data file.
  2. Making it easier for new contributors to understand the data generation process and the structure of the resulting data.
  3. Enhancing code readability and maintainability.

The results of these changes will be:

  1. Improved code documentation, making it easier for developers to understand and work with the CO2.js codebase.
  2. Better consistency in code style and documentation across the project.
  3. Easier onboarding for new contributors who want to work with or extend the data generation scripts.

No changes to the actual functionality or data have been made; this is purely a documentation improvement.

@Malay-dev
Copy link
Contributor Author

Hey @fershad can you review this PR

@fershad
Copy link
Contributor

fershad commented Oct 23, 2024

Hi @Malay-dev thanks for your contribution and patience.
I've made an a small addition to the PR to add the JSDoc comments to the output of the generators which fetch and combine the grid intensity data. Otherwise, your work here would have disappeared the next time those script ran.

@fershad fershad merged commit 668d8e4 into thegreenwebfoundation:main Oct 23, 2024
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