Skip to content

Commit

Permalink
Merge branch 'master' into fwi-effis
Browse files Browse the repository at this point in the history
  • Loading branch information
Acruve15 committed Nov 28, 2023
2 parents e3bbcf4 + 8891277 commit 75447c0
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ The pyro-risks project aims at providing the pyronear-platform with a machine le

### Prerequisites

- Python 3.6 (or more recent)
- Python 3.6 (or more recent), but < 3.12.0
- [pip](https://pip.pypa.io/en/stable/)
### Installation

Expand Down
3 changes: 2 additions & 1 deletion pyro_risks/utils/s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,8 @@ def list_files(
"""
files = []
object_filter = self.bucket.objects.filter(Prefix=prefix, Delimiter=delimiter)
if limit != 0: object_filter = object_filter.limit(limit)
if limit != 0:
object_filter = object_filter.limit(limit)
for obj in object_filter:
if not patterns or (
type(patterns) == list and any([p in obj.key for p in patterns])
Expand Down
7 changes: 0 additions & 7 deletions test/test_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ def test_include_departement(self):

@patch("pyro_risks.datasets.utils.requests.get")
def test_url_retrieve(self, mock_get):

mock_get.return_value.status_code = 200
mock_get.return_value.content = bytes("WEATHER OR WILDFIRE FILE", "utf-8")
content = utils.url_retrieve("url")
Expand All @@ -134,7 +133,6 @@ def test_url_retrieve(self, mock_get):
)

def test_get_fname(self):

url_firms = "https://firms.modaps.eosdis.nasa.gov/data/active_fire/c6/csv/MODIS_C6_Europe_24h.csv"
url_ghcn = "https://www1.ncdc.noaa.gov/pub/data/ghcn/daily/by_year/2020.csv.gz"
url_isd = "https://www.ncei.noaa.gov/data/global-hourly/archive/csv/2020.tar.gz"
Expand Down Expand Up @@ -163,7 +161,6 @@ def _mock_csv(destination, fname):
writer.writerows(unzipped_content)

def _make_tarfile(self, destination):

self._mock_csv(destination, "test_tar.csv")

full_path = os.path.join(destination, "server/")
Expand All @@ -177,7 +174,6 @@ def _make_tarfile(self, destination):
return memory_file

def _make_gzipfile(self, destination):

self._mock_csv(destination, "test_gz.csv")

full_path = os.path.join(destination, "server/")
Expand All @@ -193,7 +189,6 @@ def _make_gzipfile(self, destination):
return memory_file

def _make_zipfile(self, destination):

self._mock_csv(destination, "test_zip.csv")

full_path = os.path.join(destination, "server/")
Expand All @@ -209,7 +204,6 @@ def _make_zipfile(self, destination):
return memory_file

def _make_csv(self, destination):

self._mock_csv(destination, "test_csv.csv")

full_path = os.path.join(destination, "server/")
Expand All @@ -220,7 +214,6 @@ def _make_csv(self, destination):

@staticmethod
def _mock_fname(compression):

if compression == "tar.gz":
return ("test_tar", "csv", "tar.gz")

Expand Down
1 change: 0 additions & 1 deletion test/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ def test_predict(self):

runner = CliRunner()
with tempfile.TemporaryDirectory() as directory:

with open(os.path.join(directory, inputs_fname), "wb") as inputs:
inputs.write(mock_inputs.content)

Expand Down

0 comments on commit 75447c0

Please sign in to comment.