-
Notifications
You must be signed in to change notification settings - Fork 67
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
feat: added endpoint to return .json for the input .tiff file #185
feat: added endpoint to return .json for the input .tiff file #185
Conversation
Signed-off-by: khanjasir90 <khanmohdjasir@gmail.com>
@Namyalg could u pls take a look at this one! |
Hi @khanjasir90, looks good.
|
local/rest_api_gcbm/app.py
Outdated
|
||
# Check if simulation exists or not | ||
if not os.path.exists(f"{input_dir}"): | ||
return {"error": "Simulation does'nt exist"}, 400 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change to "Simulation with name " + title + " does not exist"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Namyalg I'll do the above mentioned change!
What if a file which does not have a JSON is supplied, eg : the gcbm_input.db file ?
|
Makes sense, the frontend would read the data from this file (.tiff) with the help of this endpoint. The data will be then displayed to the user and with another endpoint that is the |
Signed-off-by: khanjasir90 <khanmohdjasir@gmail.com>
Signed-off-by: khanjasir90 <khanmohdjasir@gmail.com>
@Namyalg @SanjaySinghRajpoot I have made the specified changes and also added some strict constraints.pls have a look at it and share what are your thoughts on the same. I have also add snapshots of the edge cases for which I have exec the endpoint. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The various scenarios are handled well.
Thank you @khanjasir90
Once these minor changes are done, it will be ready for merge!
local/rest_api_gcbm/app.py
Outdated
|
||
# Check if simulation exists or not | ||
if not os.path.exists(f"{input_dir}"): | ||
return {"error": "Simulation with the name " + title + " does'nt exists"}, 400 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change to doesn't
local/rest_api_gcbm/app.py
Outdated
input_dir_file = f"{input_dir}/{file_name}.json" | ||
# Check if file exists or not | ||
if not os.path.exists(f"{input_dir_file}"): | ||
return {"error": "File with name " + file_name + " does'nt exists"}, 400 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change to doesn't
Signed-off-by: khanjasir90 <khanmohdjasir@gmail.com>
…om/khanjasir90/FLINT.Cloud into feat/creat-endpoint-to-return-json
Thanks @Namyalg ! I have made the appropriate changes :) |
…lobal#185) * feat: added endpoint to return .json for the input .tiff file Signed-off-by: khanjasir90 <khanmohdjasir@gmail.com> * feat: updated endpoint with specified changes and some constraints Signed-off-by: khanjasir90 <khanmohdjasir@gmail.com> * feat: formatted code with black Signed-off-by: khanjasir90 <khanmohdjasir@gmail.com> * updated minor typos Signed-off-by: khanjasir90 <khanmohdjasir@gmail.com> Signed-off-by: khanjasir90 <khanmohdjasir@gmail.com> Co-authored-by: Namya LG <53875297+Namyalg@users.noreply.github.com> Signed-off-by: Freeman <freemanoparaocha@gmail.com>
…lobal#185) * feat: added endpoint to return .json for the input .tiff file Signed-off-by: khanjasir90 <khanmohdjasir@gmail.com> * feat: updated endpoint with specified changes and some constraints Signed-off-by: khanjasir90 <khanmohdjasir@gmail.com> * feat: formatted code with black Signed-off-by: khanjasir90 <khanmohdjasir@gmail.com> * updated minor typos Signed-off-by: khanjasir90 <khanmohdjasir@gmail.com> Signed-off-by: khanjasir90 <khanmohdjasir@gmail.com> Co-authored-by: Namya LG <53875297+Namyalg@users.noreply.github.com> Signed-off-by: Freeman <freemanoparaocha@gmail.com>
…lobal#185) * feat: added endpoint to return .json for the input .tiff file Signed-off-by: khanjasir90 <khanmohdjasir@gmail.com> * feat: updated endpoint with specified changes and some constraints Signed-off-by: khanjasir90 <khanmohdjasir@gmail.com> * feat: formatted code with black Signed-off-by: khanjasir90 <khanmohdjasir@gmail.com> * updated minor typos Signed-off-by: khanjasir90 <khanmohdjasir@gmail.com> Signed-off-by: khanjasir90 <khanmohdjasir@gmail.com> Co-authored-by: Namya LG <53875297+Namyalg@users.noreply.github.com> Signed-off-by: Freeman <freemanoparaocha@gmail.com>
…lobal#185) * feat: added endpoint to return .json for the input .tiff file Signed-off-by: khanjasir90 <khanmohdjasir@gmail.com> * feat: updated endpoint with specified changes and some constraints Signed-off-by: khanjasir90 <khanmohdjasir@gmail.com> * feat: formatted code with black Signed-off-by: khanjasir90 <khanmohdjasir@gmail.com> * updated minor typos Signed-off-by: khanjasir90 <khanmohdjasir@gmail.com> Signed-off-by: khanjasir90 <khanmohdjasir@gmail.com> Co-authored-by: Namya LG <53875297+Namyalg@users.noreply.github.com> Signed-off-by: Freeman <freemanoparaocha@gmail.com>
Signed-off-by: khanjasir90 khanmohdjasir@gmail.com
Pull Request Template
Description
This PR creates a /getConfig endpoint which would return the .json file for the corresponding .tiff file.
URL:http://localhost:8080/gcbm/getConfig
Curl : curl -d "title=run4&file_name=Classifier1_moja" -X POST http://localhost:8080/gcbm/getConfig
Fixes # (issue) #183
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Additional Context (Please include any Screenshots/gifs if relevant)
Output :

...
Checklist: