Skip to content

Commit c1ffe1c

Browse files
committed
refactor: remove bloat function and change repr
1 parent 601a634 commit c1ffe1c

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

epidatpy/_model.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -196,15 +196,9 @@ def request_arguments(
196196
format this call into a [URL, Params] tuple
197197
"""
198198
formatted_params = self._formatted_parameters(format_type, fields)
199-
full_url = self._full_url()
199+
full_url = add_endpoint_to_url(self._base_url, self._endpoint)
200200
return full_url, formatted_params
201201

202-
def _full_url(self) -> str:
203-
"""
204-
combines the endpoint with the given base url
205-
"""
206-
return add_endpoint_to_url(self._base_url, self._endpoint)
207-
208202
def request_url(
209203
self,
210204
format_type: Optional[EpiDataFormatType] = None,
@@ -221,10 +215,10 @@ def request_url(
221215
return u
222216

223217
def __repr__(self) -> str:
224-
return f"EpiDataCall(endpoint={self._endpoint}, params={self._formatted_parameters()})"
218+
return str(self)
225219

226220
def __str__(self) -> str:
227-
return self.request_url()
221+
return f"EpiDataCall(endpoint={self._endpoint}, params={self._formatted_parameters()})"
228222

229223
def _parse_value(
230224
self,

smoke_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
apicall = Epidata.pub_covidcast("fb-survey", "smoothed_cli", "nation", "day", "us", EpiRange(20210405, 20210410))
77

88
print(apicall)
9+
print(apicall.request_url())
910

1011
classic = apicall.classic()
1112
print(classic)

0 commit comments

Comments
 (0)