Skip to content

Commit

Permalink
Merge pull request #9 from djgagne/djgagne
Browse files Browse the repository at this point in the history
Added environment.yml and compiled all dependencies
  • Loading branch information
thunderhoser authored Dec 18, 2020
2 parents 1a8e329 + 8f98eaa commit d2d060f
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 7 deletions.
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,16 @@ Despite the lack of external documentation, there are three types of internal do
* ambhas
* descartes
* geopy
* metpy
* metpy
* roipoly
* opencv-python
* srtm.py

# Installation Instructions
1. Install the Anaconda or [Miniconda Python distribution](https://docs.conda.io/en/latest/miniconda.html).
2. Go to the GewitterGefahr top level directory.
3. Create a custom environment with all dependencies by running the following command:
`conda env create -f environment.yml`
4. Install gewittergefahr with `pip install .`.
5. Verify that GewitterGefahr is installed correctly by running pytest: `pytest`. All tests should pass, but you will see warnings.

31 changes: 31 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: gewitter
channels:
- conda-forge
dependencies:
- python=3.8
- numpy=1.18.*
- scipy
- matplotlib
- xarray
- netcdf4
- pyyaml
- pandas
- scikit-learn
- pytest
- pyproj
- jupyter
- dask
- distributed
- cartopy
- pip
- descartes
- metpy
- scikit-image
- shapely
- basemap
- pip:
- tensorflow
- keras
- roipoly
- opencv-python
- git+https://github.com/tkrajina/srtm.py.git
4 changes: 2 additions & 2 deletions gewittergefahr/gg_utils/geodetic_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import numpy
import srtm
import geopy
from geopy.distance import VincentyDistance
from geopy.distance import GeodesicDistance
from gewittergefahr.gg_utils import longitude_conversion as lng_conversion
from gewittergefahr.gg_utils import file_system_utils
from gewittergefahr.gg_utils import error_checking
Expand Down Expand Up @@ -308,7 +308,7 @@ def start_points_and_displacements_to_endpoints(
for i in range(num_points):
this_start_point_object = geopy.Point(
start_latitudes_deg.flat[i], start_longitudes_deg.flat[i])
this_end_point_object = VincentyDistance(
this_end_point_object = GeodesicDistance(
meters=scalar_displacements_metres.flat[i]).destination(
this_start_point_object, geodetic_bearings_deg.flat[i])

Expand Down
6 changes: 3 additions & 3 deletions gewittergefahr/gg_utils/temporal_tracking.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from collections import OrderedDict
import numpy
import pandas
from geopy.distance import vincenty
from geopy.distance import geodesic
from gewittergefahr.gg_utils import time_conversion
from gewittergefahr.gg_utils import storm_tracking_utils as tracking_utils
from gewittergefahr.gg_utils import error_checking
Expand Down Expand Up @@ -2229,12 +2229,12 @@ def get_storm_velocities(
this_end_latitude_deg - this_start_latitude_deg
)
else:
these_east_displacements_metres[j] = vincenty(
these_east_displacements_metres[j] = geodesic(
(this_start_latitude_deg, this_start_longitude_deg),
(this_start_latitude_deg, this_end_longitude_deg)
).meters

these_north_displacements_metres[j] = vincenty(
these_north_displacements_metres[j] = geodesic(
(this_start_latitude_deg, this_start_longitude_deg),
(this_end_latitude_deg, this_start_longitude_deg)
).meters
Expand Down
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
PACKAGE_REQUIREMENTS = [
'numpy',
'scipy',
'roipoly',
'tensorflow',
'keras',
'scikit-learn',
Expand All @@ -52,7 +53,8 @@
'shapely',
'descartes',
'geopy',
'metpy'
'metpy',
'python-srtm'
]

if __name__ == '__main__':
Expand Down

0 comments on commit d2d060f

Please sign in to comment.