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

Write models objects to JSON #294

Open
WesIngwersen opened this issue May 24, 2024 · 2 comments
Open

Write models objects to JSON #294

WesIngwersen opened this issue May 24, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@WesIngwersen
Copy link
Collaborator

JSON files for model objects are already used in useeio.js but they are retrieved from the USEEIO_API.

Alternative is to write JSON objects directly from useeior.

@WesIngwersen WesIngwersen added the enhancement New feature or request label May 24, 2024
@WesIngwersen
Copy link
Collaborator Author

Currently the following relevant writing is occurring:

  1. Matrices are written to binary in writeModelMatrices
    Recommend modifying to accept a "json" option for to_format

  2. Model metadata is written to csv in writeModelMetadata

  3. Model demands are already written to JSON in writeModelDemandstoJSON
    No changes recommended. The JSON writing here should be used as a template to modify other functions. for instance use jsonlite

  4. The Sector Crosswalk is written to csv in writeSectorCrosswalk
    Add to_format parameter with code to handle "json" option

Then create a wrapper function analogous to writeModeltoExcel() but rather it will be writeModeltoJSON()

@WesIngwersen
Copy link
Collaborator Author

to validate the output the resulting JSON needs to be compared to the JSON for a model retrieved from the USEEIO_API via useeio.js or useeio-widgets

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants