Skip to content

Commit e39ef35

Browse files
solve the s3 bucket data issue
1 parent 70fcdb4 commit e39ef35

File tree

6 files changed

+202
-208
lines changed

6 files changed

+202
-208
lines changed
30.8 KB
Binary file not shown.

dist/fimpef-0.1.41.tar.gz

32.1 KB
Binary file not shown.

poetry.lock

Lines changed: 190 additions & 189 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "fimpef"
3-
version = "0.1.40"
3+
version = "0.1.41"
44
description = "A Framework for Automatic Evaluation of Flood Inundation Mapping Predictions Evaluation"
55
authors = [
66
"Surface Dynamics Modeling Lab",

src/fimpef/ContingencyMap/PWBs3.py

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,19 @@
11
#import Libraries
22
import geopandas as gpd
33
import boto3
4+
import botocore
45
import os
56
import tempfile
67

7-
#Access Credentials
8-
aws_access_key = "**************************"
9-
aws_secret_key = "**************************"
10-
region_name = "us-east-1"
11-
12-
#S3 Bucket Info
13-
bucket_name = 'sdmlab'
14-
pwb_folder = "PWB/"
15-
16-
# Initialize S3 client with explicit credentials
8+
# Initialize an anonymous S3 client
179
s3 = boto3.client(
1810
's3',
19-
aws_access_key_id=aws_access_key,
20-
aws_secret_access_key=aws_secret_key,
21-
region_name=region_name
11+
config=botocore.config.Config(signature_version=botocore.UNSIGNED)
2212
)
2313

14+
bucket_name = 'sdmlab'
15+
pwb_folder = "PWB/"
16+
2417
def PWB_inS3(s3_client, bucket, prefix):
2518
"""Download all components of a shapefile from S3 into a temporary directory."""
2619
tmp_dir = tempfile.mkdtemp()

tests/test_evaluationfim.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
from pathlib import Path
33

44
Main_dir = (
5-
"/Users/supath/Downloads/MSResearch/FIMpef/CodeUsage/SampleData/Data/NeuseBigger"
5+
"../docs/sampledata"
66
)
7-
PWD_dir = "/Users/supath/Downloads/MSResearch/FIMPEF/CodeUsage/SampleData/PWB/USA_Detailed_Water_Bodies.shp"
8-
output_dir = "/Users/supath/Downloads/MSResearch/FIMPEF/CodeUsage/SampleData/Output"
7+
PWD_dir = "./path/to/PWB"
8+
output_dir = "../docs/Output"
99

10-
building_footprint = "/Users/supath/Downloads/MSResearch/FIMPEF/CodeUsage/SampleData/BuildingFootprint/building_footprint.gpkg"
10+
building_footprint = "./path/to/building_footprint"
1111

1212
# If user is working with user defined shapefile
13-
AOI = "/Users/supath/Downloads/MSResearch/CNN/SurrogatModeling/DataPrep/Shapefile/NeuseRiver.shp"
13+
AOI = "./path/to/shapefile"
1414

1515
# Three methods are available to evaluate the FIM,
1616
# 1. Smallest extent

0 commit comments

Comments
 (0)