ceholden / yatsm

Yet Another Time Series Model
https://yatsm.readthedocs.org/en/latest/
MIT License
63 stars 30 forks source link

Index error in rmse refit record #79

Closed valpasq closed 8 years ago

valpasq commented 8 years ago

Trying to run YATSM.CCDCesque for western Massachusetts scenes (p013r031 and p013r030), getting index errors as show below for a number of rows (which is why I'm getting stripe-y mapped outputs).

A few examples from p013r031: row 7, col 925 / row 10, col 912 / row 201, col 870 / row 213, col 879.

20:45:41:DEBUG:178:config_parser._find_pickle:Using prediction method "GLMNET_Lasso20" from config file (/usr3/graduate/valpasq/Documents/yatsm_conda/yatsm/regression/pickles/glmnet_Lasso20.pkl)
20:45:41:DEBUG:47:packaged.find_packaged_regressor:Checking data files in /usr3/graduate/valpasq/Documents/yatsm_conda/yatsm/regression/pickles for packaged regressors
20:45:41:DEBUG:171:config_parser._find_pickle:Using pre-packaged prediction method "OLS" from /usr3/graduate/valpasq/Documents/yatsm_conda/yatsm/regression/pickles/OLS.pkl
20:45:41:INFO:51:line.line:Job 1 of 200 - using config file /projectnb/landsat/projects/Massachusetts/p013r031/p013r031_config.yaml
20:45:41:DEBUG:93:cache.test_cache:Attempt reading in from cache directory?: True
20:45:41:DEBUG:95:cache.test_cache:Attempt writing to cache directory?: True
20:45:41:DEBUG:87:line.line:Responsible for lines: [   1  201  401  601  801 1001 1201 1401 1601 1801 2001 2201 2401 2601 2801
 3001 3201 3401 3601 3801 4001 4201 4401 4601 4801 5001 5201 5401 5601 5801
 6001 6201 6401 6601 6801]
20:45:41:DEBUG:130:line.line:Already processed line 1
20:45:41:DEBUG:133:line.line:Running line 201
20:45:41:DEBUG:148:readers.read_line:Read in Y from cache file

...

20:45:43:DEBUG:147:line.line:Running column 870
Traceback (most recent call last):
  File "/usr3/graduate/valpasq/conda/envs/yatsm2/bin/yatsm", line 9, in <module>
    load_entry_point('yatsm', 'console_scripts', 'yatsm')()
  File "/usr3/graduate/valpasq/conda/envs/yatsm2/lib/python2.7/site-packages/click/core.py", line 664, in __call__
    return self.main(*args, **kwargs)
  File "/usr3/graduate/valpasq/conda/envs/yatsm2/lib/python2.7/site-packages/click/core.py", line 644, in main
    rv = self.invoke(ctx)
  File "/usr3/graduate/valpasq/conda/envs/yatsm2/lib/python2.7/site-packages/click/core.py", line 991, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr3/graduate/valpasq/conda/envs/yatsm2/lib/python2.7/site-packages/click/core.py", line 837, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr3/graduate/valpasq/conda/envs/yatsm2/lib/python2.7/site-packages/click/core.py", line 464, in invoke
    return callback(*args, **kwargs)
  File "/usr3/graduate/valpasq/Documents/yatsm_conda/yatsm/cli/line.py", line 176, in line
    fitopt=fitopt, keep_regularized=stay_reg)
  File "/usr3/graduate/valpasq/Documents/yatsm_conda/yatsm/algorithms/postprocess.py", line 254, in refit_record
    refit[i_rec]['rmse'] = rec['rmse']
IndexError: invalid index

Running the most recent version of the code in a conda environment, thinking this isn't an environment-related issue...

If you think this is an actual bug, maybe we could de-bug at our next Hacky Hour?

ceholden commented 8 years ago

You have found a... hole in the tests!

Sorry! The referenced commit should fix the issue and adds test coverage to the missing lines in that function.