Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion hvpy/api_groups/movies/get_movie_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class getMovieStatusInputParameters(HvpyParameters):

id: str
format: str
verbose: Optional[bool] = False
verbose: bool = False
callback: Optional[str] = None
token: Optional[str] = None

Expand Down
8 changes: 4 additions & 4 deletions hvpy/api_groups/movies/queue_movie.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,15 @@ class queueMovieInputParameters(HvpyParameters):
events: str
eventsLabels: bool
imageScale: float
format: Optional[str] = "mp4"
frameRate: Optional[str] = "15"
format: str = "mp4"
frameRate: str = "15"
maxFrames: Optional[str] = None
scale: Optional[bool] = None
scaleType: Optional[str] = None
scaleX: Optional[float] = None
scaleY: Optional[float] = None
movieLength: Optional[float] = None
watermark: Optional[bool] = True
watermark: bool = True
width: Optional[str] = None
height: Optional[str] = None
x0: Optional[str] = None
Expand All @@ -130,7 +130,7 @@ class queueMovieInputParameters(HvpyParameters):
x2: Optional[str] = None
y2: Optional[str] = None
callback: Optional[str] = None
size: Optional[int] = 0
size: int = 0
movieIcons: Optional[int] = None
followViewport: Optional[int] = None
reqObservationDate: Optional[datetime] = None
Expand Down
4 changes: 1 addition & 3 deletions hvpy/api_groups/movies/re_queue_movie.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from typing import Optional

from hvpy.io import HvpyParameters, OutputType


Expand All @@ -24,7 +22,7 @@ class reQueueMovieInputParameters(HvpyParameters):
"""

id: str
force: Optional[bool] = False
force: bool = False

def get_output_type(self) -> OutputType:
"""
Expand Down
2 changes: 1 addition & 1 deletion hvpy/api_groups/official_clients/get_data_sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class getDataSourcesInputParameters(HvpyParameters):
.. {Shared}
"""

verbose: Optional[bool] = False
verbose: bool = False
enable: Optional[str] = None
callback: Optional[str] = None

Expand Down
8 changes: 4 additions & 4 deletions hvpy/api_groups/screenshots/take_screenshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ class takeScreenshotInputParameters(HvpyParameters):
imageScale: float
layers: str
events: Optional[str] = None
eventLabels: Optional[bool] = False
scale: Optional[bool] = False
eventLabels: bool = False
scale: bool = False
scaleType: Optional[str] = None
scaleX: Optional[int] = None
scaleY: Optional[int] = None
Expand All @@ -106,8 +106,8 @@ class takeScreenshotInputParameters(HvpyParameters):
y1: Optional[str] = None
x2: Optional[str] = None
y2: Optional[str] = None
display: Optional[bool] = False
watermark: Optional[bool] = False
display: bool = False
watermark: bool = False
callback: Optional[str] = None
_date_vaidator = validator("date", allow_reuse=True)(convert_date_to_isoformat)

Expand Down
22 changes: 11 additions & 11 deletions hvpy/facade.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def getClosestImage(

@_add_shared_docstring(getDataSourcesInputParameters)
def getDataSources(
verbose: Optional[bool] = False,
verbose: bool = False,
enable: Optional[str] = None,
callback: Optional[str] = None,
) -> Union[bytes, str, Dict[str, Any]]:
Expand Down Expand Up @@ -232,8 +232,8 @@ def takeScreenshot(
imageScale: float,
layers: str,
events: Optional[str] = None,
eventLabels: Optional[bool] = False,
scale: Optional[bool] = False,
eventLabels: bool = False,
scale: bool = False,
scaleType: Optional[str] = None,
scaleX: Optional[int] = None,
scaleY: Optional[int] = None,
Expand All @@ -245,8 +245,8 @@ def takeScreenshot(
y1: Optional[str] = None,
x2: Optional[str] = None,
y2: Optional[str] = None,
display: Optional[bool] = False,
watermark: Optional[bool] = False,
display: bool = False,
watermark: bool = False,
callback: Optional[str] = None,
):
"""
Expand Down Expand Up @@ -322,15 +322,15 @@ def queueMovie(
events: str,
eventsLabels: bool,
imageScale: float,
format: Optional[str] = "mp4",
frameRate: Optional[str] = "15",
format: str = "mp4",
frameRate: str = "15",
maxFrames: Optional[str] = None,
scale: Optional[bool] = None,
scaleType: Optional[str] = None,
scaleX: Optional[float] = None,
scaleY: Optional[float] = None,
movieLength: Optional[float] = None,
watermark: Optional[bool] = True,
watermark: bool = True,
width: Optional[str] = None,
height: Optional[str] = None,
x0: Optional[str] = None,
Expand All @@ -340,7 +340,7 @@ def queueMovie(
x2: Optional[str] = None,
y2: Optional[str] = None,
callback: Optional[str] = None,
size: Optional[int] = None,
size: int = 0,
movieIcons: Optional[int] = None,
followViewport: Optional[int] = None,
reqObservationDate: Optional[datetime] = None,
Expand Down Expand Up @@ -401,7 +401,7 @@ def queueMovie(
@_add_shared_docstring(reQueueMovieInputParameters)
def reQueueMovie(
id: str,
force: Optional[bool] = False,
force: bool = False,
) -> Union[bytes, str, Dict[str, Any]]:
"""
Re-generate a custom movie that is no longer cached on the server.
Expand All @@ -426,7 +426,7 @@ def reQueueMovie(
def getMovieStatus(
id: str,
format: str,
verbose: Optional[bool] = False,
verbose: bool = False,
callback: Optional[str] = None,
token: Optional[str] = None,
) -> Union[bytes, str, Dict[str, Any]]:
Expand Down
18 changes: 9 additions & 9 deletions hvpy/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ def createMovie(
events: str,
eventsLabels: bool,
imageScale: float,
format: Optional[str] = "mp4",
frameRate: Optional[str] = "15",
format: str = "mp4",
frameRate: str = "15",
maxFrames: Optional[str] = None,
scale: Optional[bool] = None,
scaleType: Optional[str] = None,
scaleX: Optional[float] = None,
scaleY: Optional[float] = None,
movieLength: Optional[float] = None,
watermark: Optional[bool] = True,
watermark: bool = True,
width: Optional[str] = None,
height: Optional[str] = None,
x0: Optional[str] = None,
Expand All @@ -37,12 +37,12 @@ def createMovie(
y1: Optional[str] = None,
x2: Optional[str] = None,
y2: Optional[str] = None,
size: Optional[int] = None,
size: int = 0,
movieIcons: Optional[int] = None,
followViewport: Optional[int] = None,
reqObservationDate: Optional[datetime] = None,
overwrite: bool = False,
filename: Union[str, Path] = None,
filename: Optional[Union[str, Path]] = None,
hq: bool = False,
timeout: float = 5,
) -> Path:
Expand Down Expand Up @@ -87,10 +87,10 @@ def createMovie(
input_params = locals()
# These are used later on but we want to avoid passing
# them into queueMovie.
input_params.pop("overwrite")
input_params.pop("filename")
input_params.pop("hq")
input_params.pop("timeout")
overwrite = input_params.pop("overwrite")
filename = input_params.pop("filename")
hq = input_params.pop("hq")
timeout = input_params.pop("timeout")
Comment on lines +90 to +93
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what happened here.

Copy link
Collaborator

@akash5100 akash5100 Sep 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We just removed them from input_params, I think we don't need to store them.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't we need to store them?

res = queueMovie(**input_params)
if res.get("error"):
raise RuntimeError(res["error"])
Expand Down
2 changes: 1 addition & 1 deletion hvpy/tests/test_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def test_createMovie_with_none_filename(start_time, end_time):
)
assert isinstance(result, Path)
assert result.exists()
result.unlink() # clean up
result.unlink()


def test_createMovie_timeout(start_time, end_time, tmp_path):
Expand Down