Skip to content
This repository has been archived by the owner on Jun 18, 2023. It is now read-only.

Issue in no data zone in line.py line 196 #48

Closed
bullocke opened this issue Oct 20, 2015 · 6 comments
Closed

Issue in no data zone in line.py line 196 #48

bullocke opened this issue Oct 20, 2015 · 6 comments

Comments

@bullocke
Copy link
Collaborator

https://github.com/ceholden/yatsm/blob/master/yatsm/cli/line.py#L196

File "/usr3/graduate/valpasq/Documents/yatsm/yatsm/cli/line.py", line 196, in line
output.extend(yatsm.record)
TypeError: 'NoneType' object is not iterable

Fix (tested):
Add if statement to check if record exists:

if yatsm.record is not None:
output.extend(yatsm.record)

@ceholden
Copy link
Owner

Doesn't this bit of code address the issue? It does effectively the same thing but it is placed before the phenology calculation and refitting?

https://github.com/ceholden/yatsm/blob/master/yatsm/cli/line.py#L176

if yatsm.record is None:
    continue
...
output.extend(yatsm.record)

It seems like something else is going on since it should skip to the next column if the yatsm.record is None.

@ceholden
Copy link
Owner

Oops -- so this is basically a copy of #47. The fix I implemented didn't actually work:

When I check, if yatsm.record is None, yatsm.record isn't actually None -- it's just an empty np.array. The refit or postprocess functions actually return None if the yatsm.record is empty so this is why your suggestion would work. I'm going to fix it even earlier on by actually correctly checking for an empty result.

@bullocke
Copy link
Collaborator Author

Makes sense, please notify when ready for checking and we will test.

ceholden added a commit that referenced this issue Oct 20, 2015
@ceholden
Copy link
Owner

I tried it on Val's dataset and it worked. Can you give it a go? If it's working I'll re-tag this commit as v0.5.3 and re-release it.

@valpasq
Copy link
Collaborator

valpasq commented Oct 20, 2015

I pulled the latest fix, currently running on the /Massachusetts/p012r031/ dataset without issue, i.e. no error messages, YATSM results are being written. I think this issue can be closed.

@ceholden
Copy link
Owner

Sorry about that! Anyway as I mentioned I'm going to re-release v0.5.3 by moving it one step further to this commit.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants