Skip to content

Commit

Permalink
Code runing but giving a phython version error
Browse files Browse the repository at this point in the history
  • Loading branch information
nilshempelmann committed Jun 19, 2024
1 parent 050b68c commit 804fe74
Show file tree
Hide file tree
Showing 10 changed files with 652 additions and 9 deletions.
5 changes: 5 additions & 0 deletions =3.6
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Collecting package metadata (current_repodata.json): ...working... done
Solving environment: ...working... done

# All requested packages already installed.

5 changes: 5 additions & 0 deletions =3.8
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Collecting package metadata (current_repodata.json): ...working... done
Solving environment: ...working... done

# All requested packages already installed.

8 changes: 4 additions & 4 deletions albatross/atmos_ocean_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def openDAPsst(version = '3b', debug = False, anomalies = True, **kwargs):
'endyr' : str(kwargs['endyr']),
'nbox' : str(kwargs['n_mon'])
}
fp = os.getcwd() + '/DATA/nipa/SST/' + DLargs['startmon'] + DLargs['startyr'] + \
fp = os.getcwd() + '/tests/DATA/nipa/SST/' + DLargs['startmon'] + DLargs['startyr'] + \
'_' + DLargs['endmon'] + DLargs['endyr'] + '_nbox_' + DLargs['nbox'] + '_version' + version

fp = fp + '_anoms' if anomalies else fp + '_ssts'
Expand Down Expand Up @@ -249,7 +249,7 @@ def load_climdata(**kwargs):

data = load_clim_file(kwargs['fp'])
from numpy import where, arange, zeros, inf
from utils import slp_tf
from albatross.utils import slp_tf
tran = slp_tf()
startmon = int(tran[kwargs['months'][0]])
startyr = kwargs['startyr']
Expand All @@ -271,7 +271,7 @@ def create_phase_index(debug = False, **kwargs):
from numpy import sort
index = load_clim_file(kwargs['fp'])
from numpy import where, arange, zeros, inf
from utils import slp_tf
from albatross.utils import slp_tf
tran = slp_tf()
startmon = int(tran[kwargs['months'][0]])
startyr = kwargs['startyr']
Expand Down Expand Up @@ -322,7 +322,7 @@ def create_phase_index2(**kwargs):
from numpy import sort
index = load_clim_file(kwargs['fp'])
from numpy import where, arange, zeros, inf
from utils import slp_tf
from albatross.utils import slp_tf
tran = slp_tf()
startmon = int(tran[kwargs['months'][0]])
startyr = kwargs['startyr']
Expand Down
4 changes: 2 additions & 2 deletions albatross/processes/wps_drought.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ def _handler(request, response):
import os
os.getcwd()

index_file = os.getcwd() + '/DATA/nao.txt'
clim_file = os.getcwd() + '/DATA/APGD_prcpComo.txt'
index_file = os.getcwd() + '/tests/DATA/nao.txt'
clim_file = os.getcwd() + '/tests/DATA/APGD_prcpComo.txt'
filename = 'testComoNAO'

# #### USER INPUT ####
Expand Down
4 changes: 2 additions & 2 deletions albatross/simpleNIPA.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def categorize(self, ncat = 3, hindcast = False):
def bootcorr( self, ntim = 1000, corrconf = 0.95, bootconf = 0.80,
debug = False, quick = True ):
from numpy import meshgrid, zeros, ma, isnan, linspace
from utils import vcorr, sig_test
from albatross.utils import vcorr, sig_test

corrlevel = 1 - corrconf

Expand Down Expand Up @@ -176,7 +176,7 @@ def crossvalpcr(self, xval = True, debug = False):
from scipy.stats import pearsonr as corr
from scipy.stats import linregress
from matplotlib import pyplot as plt
from utils import weightsst
from albatross.utils import weightsst
predictand = self.clim_data

if self.corr_grid.mask.sum() >= len(self.sst.lat) * len(self.sst.lon) - 4:
Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ channels:
- defaults
dependencies:
- pip
- python>=3.10
- python<=3.9
- pywps>=4.5.2,<4.7
- jinja2
- click
Expand Down
40 changes: 40 additions & 0 deletions tests/DATA/APGD_prcpComo.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
Euro4M-APGD precipitation
1971 2008
95.226 35.930 127.790 127.468 162.423 203.309 93.822 137.332 33.382 16.612 169.569 41.435
48.927 115.246 122.129 129.420 142.797 226.182 151.137 77.518 142.531 63.702 42.835 67.318
46.153 12.481 5.053 89.069 137.632 152.608 264.997 95.073 176.194 90.736 30.858 106.747
48.317 108.903 73.587 89.787 89.436 175.453 88.954 128.426 133.620 68.831 124.109 8.603
110.437 40.038 153.997 149.857 224.981 127.867 78.755 161.700 179.772 87.291 145.456 28.480
14.924 17.108 10.057 93.623 70.053 48.737 158.221 160.130 387.019 411.765 185.090 53.118
181.755 140.828 167.106 176.028 265.531 127.602 210.410 336.748 40.545 188.380 35.538 52.173
153.205 132.935 77.381 136.874 180.313 178.748 171.688 101.978 28.620 109.979 10.377 93.102
126.973 72.678 249.710 115.172 92.476 134.275 147.844 176.083 137.011 364.594 96.122 125.549
70.573 2.569 92.457 7.658 146.324 194.656 169.753 64.745 24.826 317.907 46.779 8.318
10.583 3.451 185.870 49.768 263.732 105.528 255.433 68.140 314.488 124.761 5.563 150.496
13.694 16.873 67.324 10.968 161.610 169.832 138.749 241.060 145.522 178.166 193.200 103.386
21.527 23.155 86.193 231.386 424.557 54.890 51.018 126.147 130.674 50.134 23.099 137.795
23.109 62.927 114.459 79.984 342.036 117.017 26.257 100.641 282.852 136.035 89.421 74.597
134.815 12.382 166.406 85.622 230.129 152.949 128.712 167.139 48.331 17.886 101.948 78.622
127.681 33.298 39.447 413.692 148.237 63.273 89.703 212.505 65.168 13.424 44.432 14.442
28.503 113.399 37.996 101.447 131.892 248.936 311.376 161.247 113.567 208.306 77.213 28.846
118.577 71.571 50.157 67.942 216.741 147.943 123.725 161.294 108.990 234.706 11.320 40.418
0.963 109.058 39.188 349.873 84.592 130.920 112.931 79.177 58.283 14.858 73.232 117.054
37.187 60.259 11.844 149.471 84.301 232.845 64.359 75.406 63.811 181.481 141.049 61.699
34.697 29.673 121.769 46.029 63.921 162.944 115.461 22.581 232.024 105.823 89.618 55.331
33.330 21.608 97.108 138.643 99.120 214.265 149.265 149.947 161.033 201.727 46.041 96.966
3.894 16.924 27.550 65.369 103.630 166.621 143.970 103.902 346.567 390.665 47.577 40.940
156.998 74.934 24.801 69.552 170.012 78.765 170.359 223.494 370.706 122.088 227.792 29.811
53.434 65.159 42.045 130.997 142.458 106.844 92.465 94.425 202.861 17.036 48.672 59.960
101.421 26.059 20.688 47.768 150.465 140.773 160.135 261.506 30.117 145.984 299.818 70.883
71.991 5.257 9.001 48.094 107.098 370.002 112.779 116.422 34.916 27.749 200.826 92.618
47.861 24.635 5.744 230.682 84.201 156.262 161.709 80.572 211.325 185.692 18.640 12.388
57.667 23.248 108.762 136.004 110.369 200.951 107.189 212.766 267.259 203.472 62.040 70.092
10.702 17.325 81.841 212.112 169.970 76.792 239.096 162.169 131.692 340.436 418.749 99.158
169.254 59.322 199.529 89.010 104.567 208.801 151.310 195.848 98.401 117.742 17.843 1.470
16.099 70.170 81.018 50.838 316.097 146.066 133.307 163.538 80.940 103.960 565.230 42.782
40.047 8.090 3.967 56.447 117.435 67.383 165.456 110.176 27.959 184.918 128.721 76.064
23.306 63.757 49.177 86.121 111.065 46.958 124.200 121.355 46.806 237.756 100.597 43.004
8.903 4.997 46.897 100.343 94.258 76.060 105.170 115.442 116.903 79.891 41.676 53.162
30.556 54.985 69.430 75.176 80.300 48.278 141.497 161.672 113.196 116.924 46.570 121.010
60.169 25.259 53.821 18.769 142.786 164.199 117.016 198.208 102.117 18.303 111.580 11.944
101.642 30.685 51.710 213.930 187.928 163.890 258.642 122.367 172.753 165.087 195.846 108.097
Loading

0 comments on commit 804fe74

Please sign in to comment.