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

Hide specs #17

Merged
merged 4 commits into from
Oct 28, 2024
Merged

Hide specs #17

merged 4 commits into from
Oct 28, 2024

Conversation

danyoungday
Copy link
Collaborator

Hide input specs by retrieving the string of the hard-coded variable within the source code rather than copy/pasting it out manually.

Miscellaneous fixes throughout the repo dealing with this change which are very minor.

Small updates to the README so that we are the first point of contact for anyone wanting access to the project rather than ClimateInteractive.

@danyoungday danyoungday requested a review from ofrancon October 21, 2024 21:08
@danyoungday danyoungday self-assigned this Oct 21, 2024
En-ROADS is a climate change simulator developed by Climate Interactive. We have created a wrapper around the SDK to make it simple to use in a Python application which can be found in `enroadspy`. See `enroads_runner.py` for the main class that runs the SDK. The SDK is not included in this repository and must be requested from [Climate Interactive](https://www.climateinteractive.org/).

The input data format is a crazy long JSON object which I copied out of the source code, pasted into `inputSpecs.py`, and parsed into `inputSpecs.jsonl`. This format is used by the rest of the repository.
En-ROADS is a climate change simulator developed by [Climate Interactive](https://www.climateinteractive.org/). We have created a wrapper around the SDK to make it simple to use in a Python application which can be found in `enroadspy`. See `enroads_runner.py` for the main class that runs the SDK. The SDK is not included in this repository and access to it is very limited. If you would like to use this code, please contact Project Resilience at [[email protected]](mailto:[email protected]).
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I listed myself as the point of contact, can change this later to a Project Resilience email

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you're the point of contact.
Might receive some spam though.


### Installation
Run `pip install -r requirements.txt` to install the required packages. Then run `python -m enroadspy.download_sdk` to download the SDK. In order to download the SDK environment variables must be set which can be requested online from Climate Interactive.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed another reference to Climate Interactive

return pd.read_json(Path("enroadspy/inputSpecs.jsonl"), lines=True, precise_float=True)
source_code = ""
with open("enroadspy/en-roads-sdk-v24.6.0-beta1/packages/en-roads-core/dist/index.js", "r", encoding="utf-8") as f:
source_code = f.read()
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now instead of hard-coding this JSON object we go and find it in plaintext from the source code. Eventually we need to un hard-code the version number for the SDK

@@ -28,7 +28,7 @@ def main():
"Please set the ENROADS_URL environment variable."
assert username is not None and password is not None, \
"Please set the ENROADS_ID and ENROADS_PASSWORD environment variables. \
To get access to them go to https://en-roads.climateinteractive.org/ and sign up."
To request access please refer to the README."
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed reference to Climate Interactive

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleted this file because we grab it from the SDK now

Copy link
Collaborator

@ofrancon ofrancon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

En-ROADS is a climate change simulator developed by Climate Interactive. We have created a wrapper around the SDK to make it simple to use in a Python application which can be found in `enroadspy`. See `enroads_runner.py` for the main class that runs the SDK. The SDK is not included in this repository and must be requested from [Climate Interactive](https://www.climateinteractive.org/).

The input data format is a crazy long JSON object which I copied out of the source code, pasted into `inputSpecs.py`, and parsed into `inputSpecs.jsonl`. This format is used by the rest of the repository.
En-ROADS is a climate change simulator developed by [Climate Interactive](https://www.climateinteractive.org/). We have created a wrapper around the SDK to make it simple to use in a Python application which can be found in `enroadspy`. See `enroads_runner.py` for the main class that runs the SDK. The SDK is not included in this repository and access to it is very limited. If you would like to use this code, please contact Project Resilience at [[email protected]](mailto:[email protected]).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you're the point of contact.
Might receive some spam though.

@danyoungday danyoungday merged commit 501845d into main Oct 28, 2024
1 check passed
@danyoungday danyoungday deleted the hide-specs branch October 28, 2024 16:41
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