Refactor API methods to snake_case and add OGC algorithm support#131
Closed
sujen1412 wants to merge 8 commits into
Closed
Refactor API methods to snake_case and add OGC algorithm support#131sujen1412 wants to merge 8 commits into
sujen1412 wants to merge 8 commits into
Conversation
* added ogc endpoints * added string casting and changed to list_processes wording * fixed typo jobs_ogc * added tests and updated testing instructions * edited changelog * camelcase and removed _ogc from naming conventions * Updated changelog and tests, tests are not very helpful but api is already testing all the returns * corrected list jobs function * commented out register_algorithm_from_cwl_file because its functionality is not implemented yet * added functions for registering an algorithm from a cwl file * converted more function names to snakecase * initial attempt to register alg from cwl file * cwl_text is now a string * pass cwl as raw text to API * deleted unnecessary code and print statements * deleted unnecessary packages and imports * added replace algorithm from cwl function
* updated naming to deploy when you just deploy * algorithm_deploy back to algorithm_register
) Add a default 5-second initial delay before the first status check to allow newly submitted jobs to appear in the OpenSearch database. This fixes the issue where wait_for_completion() would return immediately with incorrect status ('Deleted') if called right after job submission. Changes: - Add time module import - Add initial_delay_seconds parameter (default 5) to wait_for_completion() - Improve status check logic to handle any non-terminal state by retrying - Update docstring with parameter documentation Fixes issue #126 https://claude.ai/code/session_01KEDGhwSuoY9N5inWR9bk5u Co-authored-by: Claude <noreply@anthropic.com>
* added deprecation notices to older-style methods * updated to return exceptions
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
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.
Github Issue: link to Github issue
Description
This PR refactors the MAAP Python client to adopt snake_case naming conventions for all public API methods and adds support for new OGC (Open Geospatial Consortium) algorithm endpoints. The changes modernize the API while maintaining backward compatibility through deprecation wrappers.
Overview of work done
Method Naming Refactor:
searchGranule()→search_granule(),submitJob()→submit_job())OGC Algorithm Support:
list_algorithms()- List available algorithms via OGC endpointregister_algorithm(cwl_url)- Register algorithm from CWL URLdescribe_algorithm(process_id)- Get algorithm detailsupdate_algorithm(process_id, cwl_url)- Update algorithmdelete_algorithm(process_id)- Delete algorithmget_deployment_status(deployment_id)- Check deployment statusget_algorithm_package(process_id)- Get algorithm packagedeploy_algorithm_from_cwl_file(file_path)replace_algorithm_from_cwl_file(process_id, file_path)Additional Improvements:
test/test_ogc.py)Overview of verification done
test/test_ogc.pycovering:Overview of integration done
The refactoring maintains full backward compatibility. Existing code using camelCase methods will continue to work but will receive deprecation warnings. The new OGC endpoints integrate with the existing MAAP configuration system and authentication mechanisms.
PR checklist:
https://claude.ai/code/session_01RCMMw4pj218sriPQwmSST1