coders2iamc 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. coders2iamc-1.0.0/LICENSE +21 -0
  2. coders2iamc-1.0.0/PKG-INFO +112 -0
  3. coders2iamc-1.0.0/README.md +93 -0
  4. coders2iamc-1.0.0/coders2iamc.egg-info/PKG-INFO +112 -0
  5. coders2iamc-1.0.0/coders2iamc.egg-info/SOURCES.txt +28 -0
  6. coders2iamc-1.0.0/coders2iamc.egg-info/dependency_links.txt +1 -0
  7. coders2iamc-1.0.0/coders2iamc.egg-info/requires.txt +1 -0
  8. coders2iamc-1.0.0/coders2iamc.egg-info/top_level.txt +1 -0
  9. coders2iamc-1.0.0/coders_to_iamc/__init__.py +0 -0
  10. coders2iamc-1.0.0/coders_to_iamc/ca_system_parameters.py +33 -0
  11. coders2iamc-1.0.0/coders_to_iamc/capacity_factors.py +67 -0
  12. coders2iamc-1.0.0/coders_to_iamc/constants.py +1 -0
  13. coders2iamc-1.0.0/coders_to_iamc/cost.py +31 -0
  14. coders2iamc-1.0.0/coders_to_iamc/demand.py +62 -0
  15. coders2iamc-1.0.0/coders_to_iamc/forecasted_annual_demand.py +34 -0
  16. coders2iamc-1.0.0/coders_to_iamc/generation_cost_evolution.py +36 -0
  17. coders2iamc-1.0.0/coders_to_iamc/generation_planning_reserve.py +34 -0
  18. coders2iamc-1.0.0/coders_to_iamc/generators.py +43 -0
  19. coders2iamc-1.0.0/coders_to_iamc/grid_cells.py +34 -0
  20. coders2iamc-1.0.0/coders_to_iamc/hydro_greenfield.py +46 -0
  21. coders2iamc-1.0.0/coders_to_iamc/hydro_pump_storage.py +46 -0
  22. coders2iamc-1.0.0/coders_to_iamc/hydro_renewal.py +46 -0
  23. coders2iamc-1.0.0/coders_to_iamc/nodes.py +36 -0
  24. coders2iamc-1.0.0/coders_to_iamc/provincial_transfers.py +31 -0
  25. coders2iamc-1.0.0/coders_to_iamc/storage.py +43 -0
  26. coders2iamc-1.0.0/coders_to_iamc/technology_parameters.py +47 -0
  27. coders2iamc-1.0.0/coders_to_iamc/transmission.py +39 -0
  28. coders2iamc-1.0.0/coders_to_iamc/transmission_generic.py +32 -0
  29. coders2iamc-1.0.0/setup.cfg +4 -0
  30. coders2iamc-1.0.0/setup.py +35 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 SESIT
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,112 @@
1
+ Metadata-Version: 2.2
2
+ Name: coders2iamc
3
+ Version: 1.0.0
4
+ Summary: Scripts that pull data from the CODERS database and format it for use in the IAMC format
5
+ Home-page: https://gitlab.com/sesit/coders-to-iamc
6
+ Classifier: Programming Language :: Python :: 3
7
+ Classifier: Operating System :: OS Independent
8
+ Requires-Python: >=3.9
9
+ Description-Content-Type: text/markdown
10
+ License-File: LICENSE
11
+ Requires-Dist: pandas>=2.2.1
12
+ Dynamic: classifier
13
+ Dynamic: description
14
+ Dynamic: description-content-type
15
+ Dynamic: home-page
16
+ Dynamic: requires-dist
17
+ Dynamic: requires-python
18
+ Dynamic: summary
19
+
20
+ # CODERS to IAMC
21
+
22
+
23
+
24
+ ## Getting started
25
+
26
+ To make it easy for you to get started with GitLab, here's a list of recommended next steps.
27
+
28
+ Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
29
+
30
+ ## Add your files
31
+
32
+ - [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
33
+ - [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
34
+
35
+ ```
36
+ cd existing_repo
37
+ git remote add origin https://gitlab.com/sesit/coders-to-iamc.git
38
+ git branch -M main
39
+ git push -uf origin main
40
+ ```
41
+
42
+ ## Integrate with your tools
43
+
44
+ - [ ] [Set up project integrations](https://gitlab.com/sesit/coders-to-iamc/-/settings/integrations)
45
+
46
+ ## Collaborate with your team
47
+
48
+ - [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
49
+ - [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
50
+ - [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
51
+ - [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
52
+ - [ ] [Set auto-merge](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
53
+
54
+ ## Test and Deploy
55
+
56
+ Use the built-in continuous integration in GitLab.
57
+
58
+ - [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
59
+ - [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
60
+ - [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
61
+ - [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
62
+ - [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
63
+
64
+ ***
65
+
66
+ # Editing this README
67
+
68
+ When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thanks to [makeareadme.com](https://www.makeareadme.com/) for this template.
69
+
70
+ ## Suggestions for a good README
71
+
72
+ Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
73
+
74
+ ## Name
75
+ Choose a self-explaining name for your project.
76
+
77
+ ## Description
78
+ Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
79
+
80
+ ## Badges
81
+ On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
82
+
83
+ ## Visuals
84
+ Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
85
+
86
+ ## Installation
87
+ Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
88
+
89
+ ## Usage
90
+ Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
91
+
92
+ ## Support
93
+ Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
94
+
95
+ ## Roadmap
96
+ If you have ideas for releases in the future, it is a good idea to list them in the README.
97
+
98
+ ## Contributing
99
+ State if you are open to contributions and what your requirements are for accepting them.
100
+
101
+ For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
102
+
103
+ You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
104
+
105
+ ## Authors and acknowledgment
106
+ Show your appreciation to those who have contributed to the project.
107
+
108
+ ## License
109
+ For open source projects, say how it is licensed.
110
+
111
+ ## Project status
112
+ If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
@@ -0,0 +1,93 @@
1
+ # CODERS to IAMC
2
+
3
+
4
+
5
+ ## Getting started
6
+
7
+ To make it easy for you to get started with GitLab, here's a list of recommended next steps.
8
+
9
+ Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
10
+
11
+ ## Add your files
12
+
13
+ - [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
14
+ - [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
15
+
16
+ ```
17
+ cd existing_repo
18
+ git remote add origin https://gitlab.com/sesit/coders-to-iamc.git
19
+ git branch -M main
20
+ git push -uf origin main
21
+ ```
22
+
23
+ ## Integrate with your tools
24
+
25
+ - [ ] [Set up project integrations](https://gitlab.com/sesit/coders-to-iamc/-/settings/integrations)
26
+
27
+ ## Collaborate with your team
28
+
29
+ - [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
30
+ - [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
31
+ - [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
32
+ - [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
33
+ - [ ] [Set auto-merge](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
34
+
35
+ ## Test and Deploy
36
+
37
+ Use the built-in continuous integration in GitLab.
38
+
39
+ - [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
40
+ - [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
41
+ - [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
42
+ - [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
43
+ - [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
44
+
45
+ ***
46
+
47
+ # Editing this README
48
+
49
+ When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thanks to [makeareadme.com](https://www.makeareadme.com/) for this template.
50
+
51
+ ## Suggestions for a good README
52
+
53
+ Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
54
+
55
+ ## Name
56
+ Choose a self-explaining name for your project.
57
+
58
+ ## Description
59
+ Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
60
+
61
+ ## Badges
62
+ On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
63
+
64
+ ## Visuals
65
+ Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
66
+
67
+ ## Installation
68
+ Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
69
+
70
+ ## Usage
71
+ Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
72
+
73
+ ## Support
74
+ Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
75
+
76
+ ## Roadmap
77
+ If you have ideas for releases in the future, it is a good idea to list them in the README.
78
+
79
+ ## Contributing
80
+ State if you are open to contributions and what your requirements are for accepting them.
81
+
82
+ For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
83
+
84
+ You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
85
+
86
+ ## Authors and acknowledgment
87
+ Show your appreciation to those who have contributed to the project.
88
+
89
+ ## License
90
+ For open source projects, say how it is licensed.
91
+
92
+ ## Project status
93
+ If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
@@ -0,0 +1,112 @@
1
+ Metadata-Version: 2.2
2
+ Name: coders2iamc
3
+ Version: 1.0.0
4
+ Summary: Scripts that pull data from the CODERS database and format it for use in the IAMC format
5
+ Home-page: https://gitlab.com/sesit/coders-to-iamc
6
+ Classifier: Programming Language :: Python :: 3
7
+ Classifier: Operating System :: OS Independent
8
+ Requires-Python: >=3.9
9
+ Description-Content-Type: text/markdown
10
+ License-File: LICENSE
11
+ Requires-Dist: pandas>=2.2.1
12
+ Dynamic: classifier
13
+ Dynamic: description
14
+ Dynamic: description-content-type
15
+ Dynamic: home-page
16
+ Dynamic: requires-dist
17
+ Dynamic: requires-python
18
+ Dynamic: summary
19
+
20
+ # CODERS to IAMC
21
+
22
+
23
+
24
+ ## Getting started
25
+
26
+ To make it easy for you to get started with GitLab, here's a list of recommended next steps.
27
+
28
+ Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
29
+
30
+ ## Add your files
31
+
32
+ - [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
33
+ - [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
34
+
35
+ ```
36
+ cd existing_repo
37
+ git remote add origin https://gitlab.com/sesit/coders-to-iamc.git
38
+ git branch -M main
39
+ git push -uf origin main
40
+ ```
41
+
42
+ ## Integrate with your tools
43
+
44
+ - [ ] [Set up project integrations](https://gitlab.com/sesit/coders-to-iamc/-/settings/integrations)
45
+
46
+ ## Collaborate with your team
47
+
48
+ - [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
49
+ - [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
50
+ - [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
51
+ - [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
52
+ - [ ] [Set auto-merge](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
53
+
54
+ ## Test and Deploy
55
+
56
+ Use the built-in continuous integration in GitLab.
57
+
58
+ - [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
59
+ - [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
60
+ - [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
61
+ - [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
62
+ - [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
63
+
64
+ ***
65
+
66
+ # Editing this README
67
+
68
+ When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thanks to [makeareadme.com](https://www.makeareadme.com/) for this template.
69
+
70
+ ## Suggestions for a good README
71
+
72
+ Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
73
+
74
+ ## Name
75
+ Choose a self-explaining name for your project.
76
+
77
+ ## Description
78
+ Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
79
+
80
+ ## Badges
81
+ On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
82
+
83
+ ## Visuals
84
+ Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
85
+
86
+ ## Installation
87
+ Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
88
+
89
+ ## Usage
90
+ Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
91
+
92
+ ## Support
93
+ Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
94
+
95
+ ## Roadmap
96
+ If you have ideas for releases in the future, it is a good idea to list them in the README.
97
+
98
+ ## Contributing
99
+ State if you are open to contributions and what your requirements are for accepting them.
100
+
101
+ For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
102
+
103
+ You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
104
+
105
+ ## Authors and acknowledgment
106
+ Show your appreciation to those who have contributed to the project.
107
+
108
+ ## License
109
+ For open source projects, say how it is licensed.
110
+
111
+ ## Project status
112
+ If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
@@ -0,0 +1,28 @@
1
+ LICENSE
2
+ README.md
3
+ setup.py
4
+ coders2iamc.egg-info/PKG-INFO
5
+ coders2iamc.egg-info/SOURCES.txt
6
+ coders2iamc.egg-info/dependency_links.txt
7
+ coders2iamc.egg-info/requires.txt
8
+ coders2iamc.egg-info/top_level.txt
9
+ coders_to_iamc/__init__.py
10
+ coders_to_iamc/ca_system_parameters.py
11
+ coders_to_iamc/capacity_factors.py
12
+ coders_to_iamc/constants.py
13
+ coders_to_iamc/cost.py
14
+ coders_to_iamc/demand.py
15
+ coders_to_iamc/forecasted_annual_demand.py
16
+ coders_to_iamc/generation_cost_evolution.py
17
+ coders_to_iamc/generation_planning_reserve.py
18
+ coders_to_iamc/generators.py
19
+ coders_to_iamc/grid_cells.py
20
+ coders_to_iamc/hydro_greenfield.py
21
+ coders_to_iamc/hydro_pump_storage.py
22
+ coders_to_iamc/hydro_renewal.py
23
+ coders_to_iamc/nodes.py
24
+ coders_to_iamc/provincial_transfers.py
25
+ coders_to_iamc/storage.py
26
+ coders_to_iamc/technology_parameters.py
27
+ coders_to_iamc/transmission.py
28
+ coders_to_iamc/transmission_generic.py
@@ -0,0 +1 @@
1
+ pandas>=2.2.1
@@ -0,0 +1 @@
1
+ coders_to_iamc
File without changes
@@ -0,0 +1,33 @@
1
+ import json
2
+ from urllib.request import urlopen
3
+ import pandas as pd
4
+
5
+ from coders_to_iamc.constants import CODERS
6
+
7
+ mappings = {
8
+ 'reserve_requirements_percent': 'Reserve Requirements Percentage',
9
+ 'system_line_losses_percent': 'System Line Losses Percentage',
10
+ 'water_rentals_CAD_per_MWh': 'Water Rentals',
11
+ }
12
+
13
+
14
+ def get_data(api_key: str):
15
+ """
16
+ This function is used to get the technology parameter data from the CODERS API
17
+ """
18
+ with urlopen(f"http://206.12.95.102/CA_system_parameters?key={api_key}") as response:
19
+ response_content = response.read()
20
+ json_response = json.loads(response_content)
21
+ modeled_attributes = pd.json_normalize(json_response)
22
+
23
+ modeled_attributes = modeled_attributes.drop(columns=['notes'])
24
+
25
+ melted = modeled_attributes.melt(id_vars=['province'], var_name='variable', value_name='value')
26
+ melted['variable'] = melted['variable'].map(mappings)
27
+ melted = melted.rename(columns={'province': 'region'})
28
+ return melted
29
+
30
+
31
+ if __name__ == '__main__':
32
+ api_key = ''
33
+ df = get_data(api_key)
@@ -0,0 +1,67 @@
1
+ import json
2
+ from urllib.request import urlopen
3
+ import pandas as pd
4
+
5
+
6
+ def get_hydro_data(api_key: str, province, year):
7
+ """
8
+ This function is used to get the hydro capacity factor data from the CODERS API
9
+ """
10
+ with urlopen(f"http://206.12.95.102/hydro_capacity_factor?key={api_key}&province={province}&year={year}") as response:
11
+ response_content = response.read()
12
+ json_response = json.loads(response_content)
13
+ modeled_attributes = pd.json_normalize(json_response)
14
+
15
+ modeled_attributes = modeled_attributes[
16
+ ['province', 'local_time', 'capacity_factor']]
17
+ melted = modeled_attributes.melt(id_vars=['local_time', 'province'], var_name='variable', value_name='value')
18
+
19
+ melted['variable'] = 'Hydro Capacity Factor'
20
+ melted.rename(columns={'province': 'region', 'local_time':'time'}, inplace=True)
21
+ return melted
22
+
23
+ def get_wind_solar_data(api_key: str, year):
24
+ """
25
+ This function is used to get the VRE capacity factor data from the CODERS API
26
+ """
27
+ with urlopen(f"http://206.12.95.102/grid_cell_info?key={api_key}") as response:
28
+ response_content = response.read()
29
+ json_response = json.loads(response_content)
30
+ grid_cell = pd.json_normalize(json_response)
31
+ grid_cell = grid_cell[['longitude', 'latitude', 'balancing_area','grid_cell']]
32
+
33
+
34
+ wind = pd.read_csv(f'http://206.12.95.102/wind_capacity_factor?year=2021&key={api_key}&year={year}', index_col=0)
35
+ wind.index = wind.index-1
36
+ wind.index = pd.to_datetime(year, format='%Y') + pd.to_timedelta(wind.index, unit='h')
37
+
38
+ wind = wind.T
39
+ wind.index = wind.index.astype(int)
40
+ wind = pd.merge(wind, grid_cell, left_index=True, right_on='grid_cell')
41
+ wind['variable'] = 'VRE Capacity Factor|Wind|' + wind['grid_cell'].astype(str) + '|' + wind['latitude'].astype(str) + '_' + wind['longitude'].astype(str)
42
+ wind = wind.drop(columns=['latitude', 'longitude','grid_cell'])
43
+ wind.rename(columns={'balancing_area': 'region'}, inplace=True)
44
+
45
+ wind_melted = wind.melt(id_vars=['variable', 'region'], var_name='time', value_name='value')
46
+
47
+
48
+ solar = pd.read_csv(f'http://206.12.95.102/solar_capacity_factor?year=2021&key={api_key}&year={year}', index_col=0)
49
+ solar.index = solar.index-1
50
+ solar.index = pd.to_datetime(year, format='%Y') + pd.to_timedelta(solar.index, unit='h')
51
+
52
+ solar = solar.T
53
+ solar.index = solar.index.astype(int)
54
+ solar = pd.merge(solar, grid_cell, left_index=True, right_on='grid_cell')
55
+ solar['variable'] = 'VRE Capacity Factor|Solar|' + solar['grid_cell'].astype(str) + '|' + solar['latitude'].astype(str) + '_' + solar['longitude'].astype(str)
56
+ solar = solar.drop(columns=['latitude', 'longitude','grid_cell'])
57
+ solar.rename(columns={'balancing_area': 'region'}, inplace=True)
58
+
59
+ solar_melted = solar.melt(id_vars=['variable', 'region'], var_name='time', value_name='value')
60
+
61
+ all_cf = pd.concat([wind_melted, solar_melted], ignore_index=True)
62
+ return all_cf
63
+
64
+ if __name__ == '__main__':
65
+ api_key = 'UcnLMTPYRCAfS9Au'
66
+ # df = get_hydro_data(api_key, 'AB', 2021)
67
+ df2 = get_wind_solar_data(api_key, 2021)
@@ -0,0 +1 @@
1
+ CODERS = 'https://api.sesit.ca/'
@@ -0,0 +1,31 @@
1
+ from urllib.request import urlopen
2
+ import pandas as pd
3
+ import json
4
+
5
+ mappings = {
6
+ 'average_fuel_price_CAD_per_MMBtu': 'Cost|Fuel|',
7
+ 'variable_om_costs': 'Cost|Variable O&M|',
8
+ }
9
+
10
+ def get_data(api_key: str):
11
+ with urlopen(f"https://api.sesit.ca/generation_generic?key={api_key}") as response:
12
+ response_content = response.read()
13
+ json_response = json.loads(response_content)
14
+ modeled_attributes = pd.json_normalize(json_response)
15
+
16
+ modeled_attributes = modeled_attributes[
17
+ ['variable_om_costs', 'average_fuel_price_CAD_per_MMBtu', 'gen_type_copper']]
18
+ modeled_attributes['average_fuel_price_CAD_per_MMBtu'] = modeled_attributes[
19
+ 'average_fuel_price_CAD_per_MMBtu'].astype(float)
20
+ melted = modeled_attributes.melt(id_vars=['gen_type_copper'], var_name='variable', value_name='value')
21
+
22
+ melted['variable'] = melted['variable'].map(mappings)
23
+ melted['variable'] = melted['variable'] + melted['gen_type_copper'].astype(str)
24
+ melted = melted.drop(columns=['gen_type_copper'])
25
+
26
+ return melted
27
+
28
+ if __name__ == '__main__':
29
+ api_key = ''
30
+ df = get_data(api_key)
31
+ print(df)
@@ -0,0 +1,62 @@
1
+ import json
2
+ from urllib.request import urlopen
3
+ import pandas as pd
4
+
5
+ from coders_to_iamc.constants import CODERS
6
+
7
+
8
+ def get_canadian_data(api_key: str, province: str, year: int):
9
+ """
10
+ This function is used to get the technology parameter data from the CODERS API
11
+ """
12
+ with urlopen(f"{CODERS}/provincial_demand?key={api_key}&province={province}&year={year}") as response:
13
+ response_content = response.read()
14
+ json_response = json.loads(response_content)
15
+ modeled_attributes = pd.json_normalize(json_response)
16
+
17
+ modeled_attributes = modeled_attributes[
18
+ ['local_time', 'demand_MWh', 'province']]
19
+ melted = modeled_attributes.melt(id_vars=['local_time', 'province'], var_name='variable', value_name='value')
20
+
21
+ melted['variable'] = 'Demand'
22
+ melted.rename(columns={'province': 'region', 'local_time':'time'}, inplace=True)
23
+ return melted
24
+
25
+ def get_us_data(api_key: str, province: str, year: int):
26
+ """
27
+ This function is used to get the technology parameter data from the CODERS API
28
+ """
29
+ with urlopen(f"{CODERS}/international_transfers?key={api_key}") as response:
30
+ response_content = response.read()
31
+ json_response = json.loads(response_content)
32
+ modeled_attributes = pd.json_normalize(json_response)
33
+
34
+ states = modeled_attributes[modeled_attributes['province'] == province]['us_state'].unique()
35
+
36
+ if len(states) == 0:
37
+ return pd.DataFrame()
38
+
39
+ states_data = []
40
+ for state in states:
41
+ with urlopen(f"{CODERS}/international_transfers?key={api_key}&province={province}&us_state={state}&year={year}") as response:
42
+ response_content = response.read()
43
+ json_response = json.loads(response_content)
44
+ modeled_attributes = pd.json_normalize(json_response)
45
+
46
+ modeled_attributes = modeled_attributes[
47
+ ['local_time', 'transfers_MWh', 'province']]
48
+ melted = modeled_attributes.melt(id_vars=['local_time', 'province'], var_name='variable', value_name='value')
49
+
50
+ melted['variable'] = 'US Demand'
51
+ melted.rename(columns={'province': 'region', 'local_time':'time'}, inplace=True)
52
+ states_data.append(melted)
53
+
54
+ full_df = pd.concat(states_data)
55
+
56
+ full_df = full_df.groupby(['time', 'region', 'variable']).sum().reset_index()
57
+ return full_df
58
+
59
+
60
+ if __name__ == '__main__':
61
+ api_key = ''
62
+ df = get_canadian_data(api_key, 'AB', 2018)
@@ -0,0 +1,34 @@
1
+ import json
2
+ from urllib.request import urlopen
3
+ import pandas as pd
4
+
5
+ from coders_to_iamc.constants import CODERS
6
+
7
+ mappings = {
8
+ 'latitude': 'Generators|Latitude|',
9
+ 'longitude': 'Generators|Longitude|',
10
+ 'unit_installed_capacity': 'Generators|Capacity|',
11
+ 'network_node_code': 'Generators|Node Code|',
12
+ }
13
+
14
+
15
+ def get_data(api_key: str):
16
+ """
17
+ This function is used to get the technology parameter data from the CODERS API
18
+ """
19
+ with urlopen(f"http://206.12.95.102/forecasted_annual_demand?key={api_key}") as response:
20
+ response_content = response.read()
21
+ json_response = json.loads(response_content)
22
+ modeled_attributes = pd.json_normalize(json_response)
23
+
24
+ melted = modeled_attributes.melt(id_vars=['province', 'unit'],
25
+ var_name='time', value_name='value')
26
+
27
+ melted['variable'] = 'Forecasted Annual Demand'
28
+ melted.rename(columns={'province': 'region'}, inplace=True)
29
+ return melted
30
+
31
+
32
+ if __name__ == '__main__':
33
+ api_key = ''
34
+ df = get_data(api_key)
@@ -0,0 +1,36 @@
1
+ import json
2
+ from urllib.request import urlopen
3
+ import pandas as pd
4
+
5
+ from coders_to_iamc.constants import CODERS
6
+
7
+ mappings = {
8
+ 'reserve_requirements_percent': 'Reserve Requirements Percentage',
9
+ 'system_line_losses_percent': 'System Line Losses Percentage',
10
+ 'water_rentals_CAD_per_MWh': 'Water Rentals',
11
+ }
12
+
13
+
14
+ def get_data(api_key: str):
15
+ """
16
+ This function is used to get the technology parameter data from the CODERS API
17
+ """
18
+ with urlopen(f"http://206.12.95.102/generation_cost_evolution?key={api_key}") as response:
19
+ response_content = response.read()
20
+ json_response = json.loads(response_content)
21
+ modeled_attributes = pd.json_normalize(json_response)
22
+
23
+ columns = ['gen_type_copper']
24
+ # keep any columns that start with a year
25
+ columns.extend([col for col in modeled_attributes.columns if col.startswith('20')])
26
+ modeled_attributes = modeled_attributes[columns]
27
+ melted = modeled_attributes.melt(id_vars=['gen_type_copper'], var_name='time', value_name='value')
28
+ melted['time'] = melted['time'].apply(lambda x: int(x[:4]))
29
+ melted['variable'] = 'Generation Cost Evolution' + '|' + melted['gen_type_copper']
30
+ melted = melted.drop(columns=['gen_type_copper'])
31
+ return melted
32
+
33
+
34
+ if __name__ == '__main__':
35
+ api_key = ''
36
+ df = get_data(api_key)
@@ -0,0 +1,34 @@
1
+ import json
2
+ from urllib.request import urlopen
3
+ import pandas as pd
4
+
5
+ from coders_to_iamc.constants import CODERS
6
+
7
+ mappings = {
8
+ 'winter_wind': 'Planning Reserve|Wind|Winter',
9
+ 'winter_solar': 'Planning Reserve|Solar|Winter',
10
+ 'summer_wind': 'Planning Reserve|Wind|Summer',
11
+ 'summer_solar': 'Planning Reserve|Solar|Summer',
12
+ }
13
+
14
+
15
+ def get_data(api_key: str):
16
+ """
17
+ This function is used to get the technology parameter data from the CODERS API
18
+ """
19
+ with urlopen(f"http://206.12.95.102/generation_planning_reserve?key={api_key}") as response:
20
+ response_content = response.read()
21
+ json_response = json.loads(response_content)
22
+ modeled_attributes = pd.json_normalize(json_response)
23
+
24
+ melted = modeled_attributes.melt(id_vars=['province'],
25
+ var_name='variable', value_name='value')
26
+
27
+ melted['variable'] = melted['variable'].map(mappings)
28
+ melted.rename(columns={'province': 'region'}, inplace=True)
29
+ return melted
30
+
31
+
32
+ if __name__ == '__main__':
33
+ api_key = ''
34
+ df = get_data(api_key)
@@ -0,0 +1,43 @@
1
+ import json
2
+ from urllib.request import urlopen
3
+ import pandas as pd
4
+
5
+ from coders_to_iamc.constants import CODERS
6
+
7
+ mappings = {
8
+ 'latitude': 'Generators|Latitude|',
9
+ 'longitude': 'Generators|Longitude|',
10
+ 'unit_installed_capacity': 'Generators|Capacity|',
11
+ 'network_node_code': 'Generators|Node Code|',
12
+ 'previous_renewal_year': 'Generators|Previous Renewal Year|',
13
+ 'possible_renewal_year': 'Generators|Possible Renewal Year|',
14
+ 'closure_year': 'Generators|Closure Year|',
15
+ }
16
+
17
+
18
+ def get_data(api_key: str):
19
+ """
20
+ This function is used to get the technology parameter data from the CODERS API
21
+ """
22
+ with urlopen(f"{CODERS}/generators?key={api_key}") as response:
23
+ response_content = response.read()
24
+ json_response = json.loads(response_content)
25
+ modeled_attributes = pd.json_normalize(json_response)
26
+
27
+ modeled_attributes = modeled_attributes[
28
+ ['generation_unit_code', 'gen_type_copper', 'copper_balancing_area', 'latitude', 'longitude', 'unit_installed_capacity',
29
+ 'network_node_code', 'start_year', 'previous_renewal_year', 'possible_renewal_year', 'closure_year']]
30
+ melted = modeled_attributes.melt(id_vars=['gen_type_copper', 'generation_unit_code', 'copper_balancing_area', 'start_year'],
31
+ var_name='variable', value_name='value')
32
+
33
+ melted['variable'] = melted['variable'].map(mappings)
34
+ melted['variable'] = melted['variable'] + melted['gen_type_copper'] + '|' + melted['generation_unit_code'] + '|' + \
35
+ melted['start_year'].astype(str)
36
+ melted = melted.drop(columns=['gen_type_copper', 'generation_unit_code', 'start_year'])
37
+ melted.rename(columns={'copper_balancing_area': 'region'}, inplace=True)
38
+ return melted
39
+
40
+
41
+ if __name__ == '__main__':
42
+ api_key = ''
43
+ df = get_data(api_key)
@@ -0,0 +1,34 @@
1
+ import json
2
+ from urllib.request import urlopen
3
+ import pandas as pd
4
+
5
+ from coders_to_iamc.constants import CODERS
6
+
7
+ mappings = {
8
+ 'longitude': 'Grid Cell|Longitude',
9
+ 'latitude': 'Grid Cell|Latitude',
10
+ 'province': 'Grid Cell|Province',
11
+ 'distance_to_grid': 'Grid Cell|Distance to Grid',
12
+ 'population': 'Grid Cell|Population',
13
+ 'surface_area_offshore': 'Grid Cell|Surface Area Offshore',
14
+ 'surface_area_onshore': 'Grid Cell|Surface Area Onshore',
15
+ }
16
+
17
+
18
+ def get_data(api_key: str):
19
+ """
20
+ This function is used to get the technology parameter data from the CODERS API
21
+ """
22
+ with urlopen(f"http://206.12.95.102/grid_cell_info?key={api_key}") as response:
23
+ response_content = response.read()
24
+ json_response = json.loads(response_content)
25
+ modeled_attributes = pd.json_normalize(json_response)
26
+ melted = modeled_attributes.melt(id_vars=['grid_cell', 'balancing_area'], var_name='variable', value_name='value').rename(columns={'balancing_area': 'region'})
27
+ melted['variable'] = melted['variable'].map(mappings) + '|' + melted['grid_cell'].astype(str)
28
+ melted = melted.drop(columns=['grid_cell'])
29
+ return melted
30
+
31
+
32
+ if __name__ == '__main__':
33
+ api_key = ''
34
+ df = get_data(api_key)
@@ -0,0 +1,46 @@
1
+ import json
2
+ from urllib.request import urlopen
3
+ import pandas as pd
4
+
5
+ from coders_to_iamc.constants import CODERS
6
+
7
+ mappings = {
8
+ 'greenfield_facility_code': 'Hydro Greenfield|Facility Code|',
9
+ 'network_node_voltage': 'Hydro Greenfield|Network Node Voltage|',
10
+ 'distance_to_market_grid': 'Hydro Greenfield|Distance to Market Grid|',
11
+ 'facility_installed_capacity': 'Hydro Greenfield|Installed Capacity|',
12
+ 'minimum_generation': 'Hydro Greenfield|Minimum Generation|',
13
+ 'annualized_project_costs': 'Hydro Greenfield|Annualized Project Costs|',
14
+ 'fixed_om_costs': 'Hydro Greenfield|Fixed OM Costs|',
15
+ 'variable_om_costs': 'Hydro Greenfield|Variable OM Costs|',
16
+ 'development_time': 'Hydro Greenfield|Development Time|',
17
+ }
18
+
19
+
20
+ def get_data(api_key: str):
21
+ """
22
+ This function is used to get the technology parameter data from the CODERS API
23
+ """
24
+ with urlopen(f"{CODERS}/hydro_greenfield?key={api_key}") as response:
25
+ response_content = response.read()
26
+ json_response = json.loads(response_content)
27
+ modeled_attributes = pd.json_normalize(json_response)
28
+
29
+ modeled_attributes = modeled_attributes[
30
+ ['greenfield_facility_name', 'greenfield_facility_code',
31
+ 'copper_balancing_area', 'network_node_voltage', 'distance_to_market_grid', 'gen_type_copper',
32
+ 'facility_installed_capacity', 'minimum_generation', 'distance_to_market_grid', 'annualized_project_costs',
33
+ 'fixed_om_costs', 'variable_om_costs', 'development_time']
34
+ ]
35
+
36
+ melted = modeled_attributes.melt(id_vars=['gen_type_copper', 'greenfield_facility_name', 'copper_balancing_area'], var_name='variable', value_name='value')
37
+ melted['variable'] = melted['variable'].map(mappings)
38
+ melted['variable'] = melted['variable'] + melted['gen_type_copper'] + '|' + melted['greenfield_facility_name']
39
+ melted = melted.rename(columns={'copper_balancing_area': 'region'})
40
+ melted = melted.drop(columns=['gen_type_copper', 'greenfield_facility_name'])
41
+ return melted
42
+
43
+
44
+ if __name__ == '__main__':
45
+ api_key = ''
46
+ df = get_data(api_key)
@@ -0,0 +1,46 @@
1
+ import json
2
+ from urllib.request import urlopen
3
+ import pandas as pd
4
+
5
+ from coders_to_iamc.constants import CODERS
6
+
7
+ mappings = {
8
+ 'storage_facility_code': 'Hydro Pumped Storage|Facility Code|',
9
+ 'network_node_voltage': 'Hydro Pumped Storage|Network Node Voltage|',
10
+ 'distance_to_market_grid': 'Hydro Pumped Storage|Distance to Market Grid|',
11
+ 'facility_installed_capacity': 'Hydro Pumped Storage|Installed Capacity|',
12
+ 'minimum_generation': 'Hydro Pumped Storage|Minimum Generation|',
13
+ 'annualized_project_costs': 'Hydro Pumped Storage|Annualized Project Costs|',
14
+ 'fixed_om_costs': 'Hydro Pumped Storage|Fixed OM Costs|',
15
+ 'variable_om_costs': 'Hydro Pumped Storage|Variable OM Costs|',
16
+ 'development_time': 'Hydro Pumped Storage|Development Time|',
17
+ }
18
+
19
+
20
+ def get_data(api_key: str):
21
+ """
22
+ This function is used to get the technology parameter data from the CODERS API
23
+ """
24
+ with urlopen(f"{CODERS}/hydro_pumped_storage?key={api_key}") as response:
25
+ response_content = response.read()
26
+ json_response = json.loads(response_content)
27
+ modeled_attributes = pd.json_normalize(json_response)
28
+
29
+ modeled_attributes = modeled_attributes[
30
+ ['storage_facility_name', 'storage_facility_code',
31
+ 'copper_balancing_area', 'network_node_voltage', 'distance_to_market_grid', 'storage_type_copper',
32
+ 'facility_installed_capacity', 'minimum_generation', 'distance_to_market_grid', 'annualized_project_costs',
33
+ 'fixed_om_costs', 'variable_om_costs', 'development_time']
34
+ ]
35
+
36
+ melted = modeled_attributes.melt(id_vars=['storage_type_copper', 'storage_facility_name', 'copper_balancing_area'], var_name='variable', value_name='value')
37
+ melted['variable'] = melted['variable'].map(mappings)
38
+ melted['variable'] = melted['variable'] + melted['storage_type_copper'] + '|' + melted['storage_facility_name']
39
+ melted = melted.rename(columns={'copper_balancing_area': 'region'})
40
+ melted = melted.drop(columns=['storage_type_copper', 'storage_facility_name'])
41
+ return melted
42
+
43
+
44
+ if __name__ == '__main__':
45
+ api_key = ''
46
+ df = get_data(api_key)
@@ -0,0 +1,46 @@
1
+ import json
2
+ from urllib.request import urlopen
3
+ import pandas as pd
4
+
5
+ from coders_to_iamc.constants import CODERS
6
+
7
+ mappings = {
8
+ 'renewal_facility_code': 'Hydro Renewal|Facility Code|',
9
+ 'network_node_voltage': 'Hydro Renewal|Network Node Voltage|',
10
+ 'distance_to_market_grid': 'Hydro Renewal|Distance to Market Grid|',
11
+ 'facility_installed_capacity': 'Hydro Renewal|Installed Capacity|',
12
+ 'minimum_generation': 'Hydro Renewal|Minimum Generation|',
13
+ 'annualized_project_costs': 'Hydro Renewal|Annualized Project Costs|',
14
+ 'fixed_om_costs': 'Hydro Renewal|Fixed OM Costs|',
15
+ 'variable_om_costs': 'Hydro Renewal|Variable OM Costs|',
16
+ 'development_time': 'Hydro Renewal|Development Time|',
17
+ }
18
+
19
+
20
+ def get_data(api_key: str):
21
+ """
22
+ This function is used to get the technology parameter data from the CODERS API
23
+ """
24
+ with urlopen(f"{CODERS}/hydro_renewal?key={api_key}") as response:
25
+ response_content = response.read()
26
+ json_response = json.loads(response_content)
27
+ modeled_attributes = pd.json_normalize(json_response)
28
+
29
+ modeled_attributes = modeled_attributes[
30
+ ['renewal_facility_name', 'renewal_facility_code',
31
+ 'copper_balancing_area', 'network_node_voltage', 'distance_to_market_grid', 'gen_type_copper',
32
+ 'facility_installed_capacity', 'minimum_generation', 'distance_to_market_grid', 'annualized_project_costs',
33
+ 'fixed_om_costs', 'variable_om_costs', 'development_time','facility_installed_capacity']
34
+ ]
35
+
36
+ melted = modeled_attributes.melt(id_vars=['gen_type_copper', 'renewal_facility_name', 'copper_balancing_area'], var_name='variable', value_name='value')
37
+ melted['variable'] = melted['variable'].map(mappings)
38
+ melted['variable'] = melted['variable'] + melted['gen_type_copper'] + '|' + melted['renewal_facility_name']
39
+ melted = melted.rename(columns={'copper_balancing_area': 'region'})
40
+ melted = melted.drop(columns=['gen_type_copper', 'renewal_facility_name'])
41
+ return melted
42
+
43
+
44
+ if __name__ == '__main__':
45
+ api_key = ''
46
+ df = get_data(api_key)
@@ -0,0 +1,36 @@
1
+ import json
2
+ from urllib.request import urlopen
3
+ import pandas as pd
4
+
5
+ from coders_to_iamc.constants import CODERS
6
+
7
+ mappings = {
8
+ 'latitude': 'Nodes|Latitude|',
9
+ 'longitude': 'Nodes|Longitude|',
10
+ }
11
+
12
+
13
+
14
+ def get_data(api_key: str):
15
+ """
16
+ This function is used to get the technology parameter data from the CODERS API
17
+ """
18
+ with urlopen(f"{CODERS}/nodes?key={api_key}") as response:
19
+ response_content = response.read()
20
+ json_response = json.loads(response_content)
21
+ modeled_attributes = pd.json_normalize(json_response)
22
+
23
+ modeled_attributes = modeled_attributes[
24
+ ['node_code', 'latitude', 'longitude', 'copper_balancing_area']]
25
+ melted = modeled_attributes.melt(id_vars=['node_code', 'copper_balancing_area'], var_name='variable', value_name='value')
26
+
27
+ melted['variable'] = melted['variable'].map(mappings)
28
+ melted['variable'] = melted['variable'] + melted['node_code']
29
+ melted = melted.drop(columns=['node_code'])
30
+ melted.rename(columns={'copper_balancing_area': 'region'}, inplace=True)
31
+ return melted
32
+
33
+
34
+ if __name__ == '__main__':
35
+ api_key = ''
36
+ df = get_data(api_key)
@@ -0,0 +1,31 @@
1
+ import json
2
+ from urllib.request import urlopen
3
+ import pandas as pd
4
+
5
+ from coders_to_iamc.constants import CODERS
6
+
7
+
8
+
9
+ def get_data(api_key: str):
10
+ """
11
+ This function is used to get the technology parameter data from the CODERS API
12
+ """
13
+ with urlopen(f"{CODERS}/transfer_capacities_copper?key={api_key}") as response:
14
+ response_content = response.read()
15
+ json_response = json.loads(response_content)
16
+ modeled_attributes = pd.json_normalize(json_response)
17
+
18
+ modeled_attributes = modeled_attributes[
19
+ ['from_balancing_area', 'to_balancing_area', 'ttc_winter']
20
+ ].rename(columns={'from_balancing_area': 'region', 'to_balancing_area': 'variable', 'ttc_winter': 'value'})
21
+
22
+ modeled_attributes['region'] = modeled_attributes['region'].str.rstrip('.')
23
+ modeled_attributes['variable'] = modeled_attributes['variable'].str.rstrip('.')
24
+
25
+ modeled_attributes['variable'] = 'Inter-Provincial Transmission|Capacity|' + modeled_attributes['variable']
26
+ return modeled_attributes
27
+
28
+
29
+ if __name__ == '__main__':
30
+ api_key = ''
31
+ df = get_data(api_key)
@@ -0,0 +1,43 @@
1
+ import json
2
+ from urllib.request import urlopen
3
+ import pandas as pd
4
+
5
+ from coders_to_iamc.constants import CODERS
6
+
7
+ mappings = {
8
+ 'latitude': 'Generators|Latitude|',
9
+ 'longitude': 'Generators|Longitude|',
10
+ 'storage_capacity': 'Generators|Capacity|',
11
+ 'storage_energy': 'Generators|Storage Energy|',
12
+ 'network_node_code': 'Generators|Node Code|',
13
+ }
14
+
15
+ def get_data(api_key: str):
16
+ """
17
+ This function is used to get the technology parameter data from the CODERS API
18
+ """
19
+ with urlopen(f"{CODERS}/storage?key={api_key}") as response:
20
+ response_content = response.read()
21
+ json_response = json.loads(response_content)
22
+ modeled_attributes = pd.json_normalize(json_response)
23
+
24
+ modeled_attributes = modeled_attributes[
25
+ ['storage_facility_code', 'storage_type_copper', 'storage_capacity', 'storage_energy', 'network_node_code',
26
+ 'copper_balancing_area', 'latitude', 'longitude', 'start_year']]
27
+
28
+ melted = modeled_attributes.melt(id_vars=['storage_type_copper', 'storage_facility_code', 'copper_balancing_area', 'start_year'],
29
+ var_name='variable', value_name='value')
30
+
31
+
32
+ melted['variable'] = melted['variable'].map(mappings)
33
+ melted['variable'] = melted['variable'] + melted['storage_type_copper'] + '|' + melted[
34
+ 'storage_facility_code'] + '|' + melted['start_year'].astype(str)
35
+ melted = melted.drop(columns=['storage_type_copper', 'storage_facility_code', 'start_year'])
36
+ melted.rename(columns={'copper_balancing_area': 'region'}, inplace=True)
37
+
38
+ return melted
39
+
40
+
41
+ if __name__ == '__main__':
42
+ api_key = ''
43
+ df = get_data(api_key)
@@ -0,0 +1,47 @@
1
+ import json
2
+ from urllib.request import urlopen
3
+ import pandas as pd
4
+
5
+ from coders_to_iamc.constants import CODERS
6
+
7
+ mappings = {
8
+ 'startup_cost': 'Technology Parameter|Start Up Cost|',
9
+ 'shutdown_cost': 'Technology Parameter|Shut Down Cost|',
10
+ 'min_up_time_hours': 'Technology Parameter|Minimum Up Time|',
11
+ 'min_down_time_hours': 'Technology Parameter|Minimum Down Time|',
12
+ 'ramp_rate_percent_per_min': 'Technology Parameter|Ramp Rate|',
13
+ 'carbon_emissions': 'Technology Parameter|Carbon Intensity|',
14
+ 'min_plant_load': 'Technology Parameter|Minimum Plant Load|',
15
+ 'min_capacity_factor': 'Technology Parameter|Minimum Capacity Factor|',
16
+ 'max_capacity_factor': 'Technology Parameter|Maximum Capacity Factor|',
17
+ 'efficiency': 'Technology Parameter|Efficiency|',
18
+ 'fixed_om_costs': 'Technology Parameter|Fixed O&M Costs|',
19
+ 'variable_om_costs': 'Technology Parameter|Variable O&M Costs|',
20
+ 'annualized_capital_cost_CAD_per_MWyear': 'Technology Parameter|Annualized Capital Cost|',
21
+ 'average_fuel_price_CAD_per_MMBtu': 'Technology Parameter|Average Fuel Price|'
22
+ }
23
+
24
+ def get_data(api_key:str):
25
+ """
26
+ This function is used to get the technology parameter data from the CODERS API
27
+ """
28
+ with urlopen(f"{CODERS}/generation_generic?key={api_key}") as response:
29
+ response_content = response.read()
30
+ json_response = json.loads(response_content)
31
+ modeled_attributes = pd.json_normalize(json_response)
32
+
33
+ modeled_attributes = modeled_attributes[
34
+ ['gen_type_copper', 'startup_cost', 'shutdown_cost', 'min_up_time_hours', 'min_down_time_hours',
35
+ 'ramp_rate_percent_per_min', 'carbon_emissions', 'min_plant_load', 'min_capacity_factor', 'max_capacity_factor',
36
+ 'efficiency', 'fixed_om_costs', 'variable_om_costs', 'annualized_capital_cost_CAD_per_MWyear', 'average_fuel_price_CAD_per_MMBtu']]
37
+
38
+ melted = modeled_attributes.melt(id_vars=['gen_type_copper'], var_name='variable', value_name='value')
39
+ melted['variable'] = melted['variable'].map(mappings)
40
+ melted['variable'] = melted['variable'] + melted['gen_type_copper']
41
+ melted = melted.drop(columns='gen_type_copper')
42
+ return melted
43
+
44
+
45
+ if __name__ == '__main__':
46
+ api_key = ''
47
+ df = get_data(api_key)
@@ -0,0 +1,39 @@
1
+ import json
2
+ from urllib.request import urlopen
3
+ import pandas as pd
4
+
5
+ from coders_to_iamc.constants import CODERS
6
+
7
+ mappings = {
8
+ 'network_node_code_starting': 'Intra-Provincial Transmission|Start Node|',
9
+ 'network_node_code_ending': 'Intra-Provincial Transmission|End Node|',
10
+ 'ttc_winter': 'Intra-Provincial Transmission|Capacity|',
11
+ 'reactance': 'Intra-Provincial Transmission|Reactance|',
12
+ }
13
+
14
+
15
+
16
+ def get_data(api_key: str):
17
+ """
18
+ This function is used to get the technology parameter data from the CODERS API
19
+ """
20
+ with urlopen(f"{CODERS}/transmission_lines?key={api_key}") as response:
21
+ response_content = response.read()
22
+ json_response = json.loads(response_content)
23
+ modeled_attributes = pd.json_normalize(json_response)
24
+
25
+ modeled_attributes = modeled_attributes[
26
+ ['transmission_line_id', 'network_node_code_starting', 'network_node_code_ending', 'ttc_winter', 'reactance',
27
+ 'province']]
28
+ melted = modeled_attributes.melt(id_vars=['transmission_line_id', 'province'], var_name='variable', value_name='value')
29
+
30
+ melted['variable'] = melted['variable'].map(mappings)
31
+ melted['variable'] = melted['variable'] + melted['transmission_line_id'].astype(str)
32
+ melted = melted.drop(columns=['transmission_line_id'])
33
+ melted.rename(columns={'province': 'region'}, inplace=True)
34
+ return melted
35
+
36
+
37
+ if __name__ == '__main__':
38
+ api_key = ''
39
+ df = get_data(api_key)
@@ -0,0 +1,32 @@
1
+ import json
2
+ from urllib.request import urlopen
3
+ import pandas as pd
4
+
5
+ from coders_to_iamc.constants import CODERS
6
+
7
+ mappings = {
8
+ 'reserve_requirements_percent': 'Reserve Requirements Percentage',
9
+ 'system_line_losses_percent': 'System Line Losses Percentage',
10
+ 'water_rentals_CAD_per_MWh': 'Water Rentals',
11
+ }
12
+
13
+
14
+ def get_data(api_key: str):
15
+ """
16
+ This function is used to get the technology parameter data from the CODERS API
17
+ """
18
+ with urlopen(f"{CODERS}/transmission_generic?key={api_key}") as response:
19
+ response_content = response.read()
20
+ json_response = json.loads(response_content)
21
+ modeled_attributes = pd.json_normalize(json_response)
22
+
23
+ modeled_attributes = modeled_attributes[
24
+ ['annualized_project_cost_CAD_per_MWkmyear', 'transmission_type']
25
+ ].rename(columns={'annualized_project_cost_CAD_per_MWkmyear': 'value', 'transmission_type': 'variable'})
26
+ modeled_attributes['variable'] = 'Annualized Project Cost|' + modeled_attributes['variable']
27
+ return modeled_attributes
28
+
29
+
30
+ if __name__ == '__main__':
31
+ api_key = ''
32
+ df = get_data(api_key)
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,35 @@
1
+ # coders-to-iamc/setup.py
2
+
3
+ from os.path import abspath, dirname, join
4
+
5
+ from setuptools import find_packages, setup
6
+
7
+ # Define the directory containing this file
8
+ this_dir = abspath(dirname(__file__))
9
+
10
+ # Read the long description from README.md
11
+ with open(join(this_dir, "README.md"), encoding="utf-8") as f:
12
+ long_description = f.read()
13
+
14
+ # Read the global requirements.txt
15
+ with open(join(this_dir, "requirements.txt"), encoding="utf-8") as f:
16
+ requirements = f.read().splitlines()
17
+
18
+
19
+ setup(
20
+ name="coders2iamc",
21
+ version="1.0.0",
22
+ description="Scripts that pull data from the CODERS database and format it for use in the IAMC format",
23
+ long_description=long_description,
24
+ long_description_content_type="text/markdown",
25
+ url="https://gitlab.com/sesit/coders-to-iamc",
26
+ install_requires=requirements,
27
+ packages=find_packages(include=["coders_to_iamc"]),
28
+ include_package_data=True,
29
+ classifiers=[
30
+ "Programming Language :: Python :: 3",
31
+ "Operating System :: OS Independent",
32
+ ],
33
+ python_requires=">=3.9", # Specify the Python versions you support
34
+ package_data={"": ["*.yaml"]},
35
+ )