Skip to content

Commit

Permalink
Update exercises 1 and 2 with blank lines to match changes to later e…
Browse files Browse the repository at this point in the history
…xercises (blank lines not picked up by black).
  • Loading branch information
jatkinson1000 committed Jun 27, 2024
1 parent fe0c39e commit 61e5ced
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 6 deletions.
3 changes: 0 additions & 3 deletions exercises/01_base_code/precipitation_climatology.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ def plot_zonal(data):


def get_country_ann_avg(data, countries):

data_avg = data['pr'].groupby('time.year').mean('time', keep_attrs=True)
data_avg = convert_pr_units(data_avg)

Expand Down Expand Up @@ -113,7 +112,6 @@ def get_country_ann_avg(data, countries):


def plot_enso(data):

enso = data['pr'].sel(lat=slice(-1, 1)).sel(lon=slice(120, 280)).mean(dim="lat", keep_attrs=True)
# print(enso)
# .groupby('time.year').mean('time', keep_attrs=True)
Expand Down Expand Up @@ -238,7 +236,6 @@ def main(pr_file, season="DJF", output_file="output.png", gridlines=False, mask=
plt.savefig(output_file, dpi=200) # Save figure to file

if __name__ == '__main__':

input_file = "../../data/pr_Amon_ACCESS-ESM1-5_historical_r1i1p1f1_gn_201001-201412.nc"
# season_to_plot = "DJF"
# season_to_plot = "MAM"
Expand Down
3 changes: 0 additions & 3 deletions exercises/02_formatting/precipitation_climatology.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ def plot_zonal(data):


def get_country_ann_avg(data, countries):

data_avg = data['pr'].groupby('time.year').mean('time', keep_attrs=True)
data_avg = convert_pr_units(data_avg)

Expand Down Expand Up @@ -113,7 +112,6 @@ def get_country_ann_avg(data, countries):


def plot_enso(data):

enso = data['pr'].sel(lat=slice(-1, 1)).sel(lon=slice(120, 280)).mean(dim="lat", keep_attrs=True)
# print(enso)
# .groupby('time.year').mean('time', keep_attrs=True)
Expand Down Expand Up @@ -238,7 +236,6 @@ def main(pr_file, season="DJF", output_file="output.png", gridlines=False, mask=
plt.savefig(output_file, dpi=200) # Save figure to file

if __name__ == '__main__':

input_file = "../../data/pr_Amon_ACCESS-ESM1-5_historical_r1i1p1f1_gn_201001-201412.nc"
# season_to_plot = "DJF"
# season_to_plot = "MAM"
Expand Down

0 comments on commit 61e5ced

Please sign in to comment.