Skip to content

Commit

Permalink
batch commit
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenjlee committed Mar 27, 2024
1 parent 9f78bbc commit 62e7319
Show file tree
Hide file tree
Showing 42 changed files with 4,849 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/beacon.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

103 changes: 103 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# beacon

This repo will be available very soon.
More documentation will be available very soon.
Empty file added beacon/__init__.py
Empty file.
Empty file added beacon/data/__init__.py
Empty file.
47 changes: 47 additions & 0 deletions beacon/data/load_data.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import os, sys, argparse
import geopandas as gpd
from dotenv import load_dotenv, find_dotenv

load_dotenv(find_dotenv())
sys.path.append(os.environ.get("PROJECT_ROOT"))


def parse_args(args):
parser = argparse.ArgumentParser(
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
description='')

parser.add_argument('-bp', '--bldgs_path',
default=os.path.join(os.environ.get("PROJECT_OUT"),
'RWA_elec_buildings_sjoin.geojson'),
help='')
parser.add_argument('-sgj', '--save_geojson', default=False,
help='Whether (if True) to save a geojson, or (if False) just a csv. '
'Saving a geojson requires significantly more memory.')
parser.add_argument('-r', '--rows', type=int, default=20000, help='the number of rows to load')

return parser.parse_args(args)


def load_data(bldgs_path, rows, save_geojson):
if save_geojson:
bldgs_df = gpd.read_file(bldgs_path, rows=rows)
else:
bldgs_df = gpd.read_file(bldgs_path, rows=rows, ignore_geometry=True)

return bldgs_df


def main(args):
args = parse_args(args)
args = args.__dict__

bldgs_df = load_data(args['bldgs_path'], args['rows'], args['save_geojson'])

print(bldgs_df)

print('done!')


if __name__ == "__main__":
main(sys.argv[1:])
Empty file added beacon/models/.gitkeep
Empty file.
Empty file added beacon/models/__init__.py
Empty file.
Loading

0 comments on commit 62e7319

Please sign in to comment.