Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error with prepare_graph_inputs #37

Open
adamfreedman opened this issue Aug 11, 2024 · 2 comments
Open

error with prepare_graph_inputs #37

adamfreedman opened this issue Aug 11, 2024 · 2 comments

Comments

@adamfreedman
Copy link

after running through the workshop jupyter notebook without a problem, I modified the notebooks to run on our data ... provisionally using, for testint purposes, a simple "outer" file that defines a rectangle enclosing all of our sampling sites buffered by 0.25 degrees. the resulting error is as follows:


AssertionError                            Traceback (most recent call last)
File <timed exec>:7

File [~/miniforge3/envs/feems/lib/python3.8/site-packages/feems/utils.py:107](http://localhost:8888/lab/tree/~/miniforge3/envs/feems/lib/python3.8/site-packages/feems/utils.py#line=106), in prepare_graph_inputs(coord, ggrid, translated, buffer, outer)
    104     grid.append((v[0], v[1]))
    105 grid = np.array(grid)
--> 107 assert grid.shape[0] != 0, "grid is empty changing translation"
    109 # un-translate
    110 if translated:

AssertionError: grid is empty changing translation

grid_path does in fact correctly point to "grid_100.shp" that is part of the feems repo. my understanding is the grid is global, so the fact that my x,y coordinates are in Central Africa should be irrelevant correct? Fwiw, the *coord file was the same that I'd used with eems for another project, i.e x (long) 1st column, y (lat) 2nd column. any guidance would be appreciated

@adamfreedman
Copy link
Author

I should clarify, that I initially ran "without a problem" on the example data from Schweizer et al. 2015

@VivaswatS
Copy link
Collaborator

Hi @adamfreedman, you're correct on all counts here. Can you try the same code but without specifying an outer file and letting FEEMS choose it for you?
outer, edges, grid, _ = prepare_graph_inputs(coord=coord, ggrid=grid_path, translated=False, buffer=1, outer=None)

If this works, then there might be something wrong with the outer file you specified

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

No branches or pull requests

2 participants