Skip to content

Commit

Permalink
Add parameters_id filter to Locations class (#6)
Browse files Browse the repository at this point in the history
Co-authored-by: Gabriel Fosse <kraken+majesticio@users.noreply.github.com>
  • Loading branch information
majesticio and Gabriel Fosse authored Dec 21, 2023
1 parent ff31c13 commit bc67c00
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions openaq/_async/models/locations.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ async def list(
bbox: Union[Tuple[float, float, float, float], None] = None,
providers_id: Union[int, List[int], None] = None,
countries_id: Union[int, List[int], None] = None,
parameters_id: Union[int, List[int], None] = None,
iso: Union[str, None] = None,
monitor: Union[bool, None] = None,
mobile: Union[bool, None] = None,
Expand All @@ -59,6 +60,7 @@ async def list(
* `bbox` - Filters locations using a bounding box. Cannot be used with `coordinates` or `radius`
* `providers_id` - Filters results by selected providers ID(s)
* `countries_id` - Filters results by selected countries ID(s)
* `parameters_id` - Filters results by selected parameters ID(s)
* `iso` - Filters results by selected country code
* `monitor` - Filters results by reference grade monitors (`true`), air sensors (`false`), or both if not used
* `mobile` - Filters results for mobile sensors (`true`), non-mobile sensors (`false`), or both if not used
Expand All @@ -73,6 +75,7 @@ async def list(
bbox: Geospatial bounding box of min X, min Y, max X, max Y in WGS 84 coordinates. Limited to four decimals precision.
providers_id: Single providers ID or an array of IDs.
countries_id: Single countries ID or an array of IDs.
parameters_id: Single parameters ID or an array of IDs.
iso: 2 letter ISO 3166-alpha-2 country code.
monitor: Boolean for reference grade monitors (true) or air sensors (false)
mobile: Boolean mobile locations (true) or not mobile locations (false).
Expand Down Expand Up @@ -100,6 +103,7 @@ async def list(
bbox=bbox,
providers_id=providers_id,
countries_id=countries_id,
parameters_id=parameters_id,
iso=iso,
monitor=monitor,
mobile=mobile,
Expand Down
4 changes: 4 additions & 0 deletions openaq/_sync/models/locations.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def list(
bbox: Union[Tuple[float, float, float, float], None] = None,
providers_id: Union[int, List[int], None] = None,
countries_id: Union[int, List[int], None] = None,
parameters_id: Union[int, List[int], None] = None,
iso: Union[str, None] = None,
monitor: Union[bool, None] = None,
mobile: Union[bool, None] = None,
Expand All @@ -59,6 +60,7 @@ def list(
* `bbox` - Filters locations using a bounding box. Cannot be used with `coordinates` or `radius`
* `providers_id` - Filters results by selected providers ID(s)
* `countries_id` - Filters results by selected countries ID(s)
* `parameters_id` - Filters results by selected parameters ID(s)
* `iso` - Filters results by selected country code
* `monitor` - Filters results by reference grade monitors (`true`), air sensors (`false`), or both if not used
* `mobile` - Filters results for mobile sensors (`true`), non-mobile sensors (`false`), or both if not used
Expand All @@ -73,6 +75,7 @@ def list(
bbox: Geospatial bounding box of min X, min Y, max X, max Y in WGS 84 coordinates. Limited to four decimals precision.
providers_id: Single providers ID or an array of IDs.
countries_id: Single countries ID or an array of IDs.
parameters_id: Single parameters ID or an array of IDs.
iso: 2 letter ISO 3166-alpha-2 country code.
monitor: Boolean for reference grade monitors (true) or air sensors (false)
mobile: Boolean mobile locations (true) or not mobile locations (false).
Expand Down Expand Up @@ -100,6 +103,7 @@ def list(
bbox=bbox,
providers_id=providers_id,
countries_id=countries_id,
parameters_id=parameters_id,
iso=iso,
monitor=monitor,
mobile=mobile,
Expand Down
4 changes: 4 additions & 0 deletions tests/test_shared_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
'bbox': [42.0, 42.0, 42.0, 42.0],
"providers_id": 42,
"countries_id": 42,
"parameters_id": 2,
'iso': 'us',
'monitor': True,
'mobile': False,
Expand All @@ -30,6 +31,7 @@
'bbox': '42.0,42.0,42.0,42.0',
"providers_id": 42,
"countries_id": 42,
"parameters_id": 2,
'iso': 'us',
'monitor': True,
'mobile': False,
Expand All @@ -41,10 +43,12 @@
{
"providers_id": [1, 2, 3],
"countries_id": [1, 2, 3],
"parameters_id": [1, 2, 10],
},
{
"providers_id": '1,2,3',
"countries_id": '1,2,3',
"parameters_id": '1,2,10',
},
),
],
Expand Down

0 comments on commit bc67c00

Please sign in to comment.