-
Notifications
You must be signed in to change notification settings - Fork 4
Create a module for the frontend of the endpoint function #33
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
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
b534aa0
initialize facade.py
akash5100 c3b6cf6
Update hvpy/__init__.py
akash5100 9134a3f
Add test for facade
akash5100 4068907
fix precommit issue
akash5100 9b0a601
Complete the docstring decorator
akash5100 46f8d70
Update user guide
akash5100 de9e275
update keyword only to positional argument
akash5100 f86d06b
use locals directly as arg
akash5100 d01fbb5
Set keyword args to pydantic base
akash5100 25d4946
rename test
akash5100 d26f71c
code refactor & add docstring example
akash5100 d9ddc9f
Add return types to decorators and functions
akash5100 17ebcd1
Update hvpy/facade.py
akash5100 b546e34
Update decorator
akash5100 3426fc5
update doc sub code
nabobalis acaa047
fix the error in the docstring
akash5100 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,2 @@ | ||
| from .facade import * # NOQA | ||
| from .version import __version__ |
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| from typing import Any, Dict, Union | ||
| from datetime import datetime | ||
|
|
||
| from hvpy.core import execute_api_call | ||
| from hvpy.parameters import * | ||
| from hvpy.utils import add_shared_docstring | ||
|
|
||
| __all__ = ["getJP2Image"] | ||
|
|
||
|
|
||
| @add_shared_docstring(getJP2ImageInputParameters) | ||
| def getJP2Image( | ||
| date: datetime, | ||
akash5100 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| sourceId: int, | ||
| jpip: bool = False, | ||
| json: bool = False, | ||
| ) -> Union[bytes, str, Dict[str, Any]]: | ||
| """ | ||
| Retrieve a JP2000 image from the helioviewer.org API. | ||
|
|
||
| {Insert} | ||
| Examples | ||
| -------- | ||
| >>> from hvpy import getJP2Image | ||
| >>> getJP2Image(date=datetime(2019,1,1), sourceId=1, jpip=True) | ||
| 'jpip://helioviewer.org:8090/EIT/2013/08/07/195/2013_08_07__01_13_50_146__SOHO_EIT_EIT_195.jp2' | ||
| """ | ||
akash5100 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| params = getJP2ImageInputParameters(date=date, sourceId=sourceId, jpip=jpip, json=json) | ||
| return execute_api_call(input_parameters=params) | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| from typing import Any, Callable | ||
|
|
||
| __all__ = ["add_shared_docstring"] | ||
|
|
||
|
|
||
| def add_shared_docstring(input_class) -> Callable[[Any], Any]: | ||
| def decorator(func): | ||
| if "{Shared}" in input_class.__doc__: | ||
| split_doc = input_class.__doc__.split("{Shared}") | ||
| func.__doc__ = func.__doc__.replace("{Insert}", split_doc[1]) | ||
| input_class.__doc__ = input_class.__doc__.replace("{Shared}", "") | ||
| return func | ||
|
|
||
| return decorator |
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.
Uh oh!
There was an error while loading. Please reload this page.