Skip to content

Commit

Permalink
Simplify load_all
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertLucey committed Jan 1, 2022
1 parent 6826c03 commit 59552d0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/road_collisions_uk/bin/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

def main():
print('NOTE: Since UK data is so large, only loading data from 2020')
collisions = Collisions.load_all(region='uk', year=2020)
collisions = Collisions.load_all(year=2020)

logger.info('Loaded %s collisions', (len(collisions)))
logger.info('Do something with the data in the variable \'collisions\'...')
Expand Down
4 changes: 2 additions & 2 deletions src/road_collisions_uk/models/collision.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,11 @@ def filter(self, **kwargs):
)

@staticmethod
def load_all(region=None, year=None):
def load_all(year=None):
import road_collisions_uk
return Collisions.from_dir(
'/opt/road_collisions/',
region=region,
region='uk',
year=year
)

Expand Down

0 comments on commit 59552d0

Please sign in to comment.