GCBM Simulation API and End-Points for upload#152
Closed
ankitaS11 wants to merge 2 commits into
Closed
Conversation
Contributor
|
Closed in favour of #163 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Template
Description
This PR introduces a
GCBMSimulationclass, and end-pointuploadfor uploading files for categories:disturbance, classifiers, miscellaneous(disturbance is kept optional). The way to add a file usingGCBMSimulationis:And it will generate the JSON file for you, in
templates/config/folder.The API also makes sure to raise an error for missing categories once it’s done. For example, if you passed only disturbance and classifier files using
curl -Fcommand, it will raise an error like:{ "error": "Missing files for categories: [‘disturbance’, 'miscellaneous', 'config_files', 'input'], they are required for the simulation to run" }So that the user is aware which categories they missed. For this purpose, I created an enum
REQUIREDand corresponding to each category we have a “YES/NO” (REQUIRED.yes, REQUIRED.no) - so, if in the future, a category’s “required” value is changed, we can just change it in theapp.pytoREQUIRED.<new_value(yes/no)>.To support any new categories, it should be straight forward:
I took a look at the expected JSON files, I was able to add:
cell<Lat/Long>Size, block<Lat/Long>size, tile<Lat/Long>Size, nodata, layer_type, layer_datato the JSON file. For other data in “attributes” key, like “disturbance_type”, “transition” etc. - those need to be hard-coded for each year file?TODOs:
GCBMSimulationclassFixes # (issue)
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please see the README for any instructions on how to run the end-point. Tests will be added once all the categories have been added.
Additional Context (Please include any Screenshots/gifs if relevant)
...
Checklist:
Thanks!
Cc: @aornugent , @Namyalg, @padmajabhol, @SanjaySinghRajpoot @YashKandalkar