-
Notifications
You must be signed in to change notification settings - Fork 6
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
Migrate from command-line proj to pyproj(Low priority) #9
Comments
Maybe the two list are not equals because something happens during the call of Maybe you have a problem with that program. Could you add a print/debug statement there ? Line 683 in c345d6f
If we can know what this variable is, maybe we could determine if this causes the problem. It should be a long list of coordinates. For me it looks like this: |
Looks like it is probably empty or: [' '] I also checked stdout_tuple which was: (b'', None) None of that seems normal. |
It seems you have a problem with this proj package. Probably it is not install on your computer. You can try by running To install, you can follow these instructions for linux: https://github.com/OSGeo/PROJ/blob/master/docs/source/install.rst#debian |
thanks! I installed that, but the basic error still occurs. Maybe proj wasn't installing correctly? I did some double checking and finally ran it on windows and as you mentioned this bug doesn't occur there. It looks like some sort of save error is still there, Although the line which it is exiting at is different than the one it did last time. Which might be promising, or mean things are worse and we have new bugs on top of the old there.. |
@JonathanLochridge I modified a bit that part of the code to better handle the proj issue and also fixed one or two other bugs. See #11 Maybe that helps |
So, I looked at the code in the PR and tested it, But the proj error didn't seem to actually trigger? On a second check, it seems like there is some kind of issue with how my local github instance is syncing? I specifically said to fetch, and github desktop claims it is up to date, and I checked on the site too. But that PR wasn't there. Second glance is that seems to be because the code wasn't merged. I feel a little silly there. After actually double checking that I confirmed that the error was thrown. Not sure why it isn't registering it as being installed? Maybe since I was running in VSCode? It actually can manage dependancies though. Well, I can try running it in a bare terminal. since I know for sure I installed proj there. |
Exception: Calling the subprocess proj did not work. (This is my terminal log, it shows proj as being installed but it still crashes and triggers the error.) |
No worries for the github thing ;) I just merged now the pull request. Okay so now at least we know the problem is with proj. What happens if you run |
$ proj I checked and i found a proj file in usr/bin which I am pretty sure is part of the core PATH. So, in theory I should have access to it everywhere. But running the game from any terminal still has the bug on game start. (Or in VSCode, or pycharm.) So, I tried checking and VScode can't run it. Perhaps including it in the requirements as well could help for linux installs that use something like code, pycharm, etc? Not sure? But the bug still occurs even when run outside of it. Which makes me think that maybe proj is only part of the issue. Or it is something else related to proj rather than it directly not installing. |
Hey, I looked into this a bit. I think the big/good solution would be to just migrate away from using various command-line versions of proj, and then instead use pyproj. Shouldn't be too hard to change honestly, it's really just a matter of finding the What I did do was to insert ubuntu- and mac-specific installations of proj in the CI/CD tests now, here, hopefully that can be illustrative. And it also ensure that there are tests for proj actually working. Can I have a code-review please? (note of interest: a first version, 15 years ago or so, actually just used trig-functions, sin, cos, tan to do the same, in python - but proj turned out to be sooo much faster, so I ditched that) |
Oh, cool! 20 lines isn't terrible, are you sure it isn't used anywhere else? If so, I can start on trying to change that today maybe? Probably won't finish today, but I might. I want to read a bit of the pyproj documentation and such too. I definately can put it in the requirements.txt file at least. |
Pretty sure -- that function is called a lot of other times though, but it's only there it calls the executable proj And give me a ✅ here please |
Ok, things ended up not going as I planned today. So I didn't get a chance to really work on things, due to a sudden change of plans. I don't have anything planned tommorow, so I am going to try changing just that bit, And then after testing that I can check the issue you linked to see if that resolves the saving issue for me? If I read it correctly it is supposed to do that? |
So, with the new changes this seems to be working for me at least. (The root issue.) It doesn't seem like we changed to pyproj, but maybe I missed that? I could work on that today, but I am unsure if it is necessary or not? |
Hmmm... maybe I lost the thread on errors, because in these last 4 PRs several were fixed. Could be the reason this cleared up for you,. That proj -> pyproj is more like an ease-of-install-thing, so that users are not asked to install separate programs outside of |
That does seem pretty important, but lower priority now. |
Hey, wait - I had one thing you could do to test 'necessariness' @JonathanLochridge --- go to the moon (in the game) or ... anywhere but Mars and Earth really, and zoom in and spin around. Because they are not cached, so they'd activate proj. If it doesn't break, then it's low priority |
I am working on it on branch |
That is a great idea! |
This issue was fixed and implemented in #26 |
Issue orginally found from a crash error. But now crashing doesn't generally occur, However an opportunity to improve potential user troubleshooting, and make packaging up the program easier in the future it migrating from pyproj to proj. The main benefits will come for linux, but it may make packaging the windows version easier in the future.
Old first post preserved for posterity below:
Crashes on creating a new game, after inputting all the options for a company.
File "/Documents/GitHub/highfrontier/intro.py", line 396, in <module> introGui = IntroGui() ^^^^^^^^^^ File "/Documents/GitHub/highfrontier/intro.py", line 70, in __init__ self.receive_click(event) File "/Documents/GitHub/highfrontier/intro.py", line 86, in receive_click button.activate(event) File "/Documents/GitHub/highfrontier/gui_components.py", line 497, in activate return_value = self.function(self.label, self.function_parameter) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Documents/GitHub/highfrontier/intro.py", line 30, in start_new_game self.main.start_loop(companyName = cn, File "/Documents/GitHub/highfrontier/main.py", line 92, in start_loop surface = sol.current_planet.draw_entire_planet(sol.current_planet.eastern_inclination,sol.current_planet.northern_inclination,sol.current_planet.projection_scaling) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Documents/GitHub/highfrontier/planet.py", line 1148, in draw_entire_planet surface = self.draw_bases(surface,eastern_inclination,northern_inclination,projection_scaling) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Documents/GitHub/highfrontier/planet.py", line 1400, in draw_bases base_positions = self.calculate_base_positions(eastern_inclination, northern_inclination, projection_scaling) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Documents/GitHub/highfrontier/planet.py", line 1214, in calculate_base_positions if plane_coordinates[i] != "Not seen": ~~~~~~~~~~~~~~~~~^^^ IndexError: list index out of range
From some tracing this might be due to an error or bad arguments passed to a function:
sphere_to_plane_total
I tried to make sense of it, The comment seems to suggest it is supposed be passed a list? But, It doesn't look like it is being passed one to me? So either I am misreading things, or like maybe it is supposed to but it's not in reality?
But somehow there is a mismatch between the size of "base names" and the list of coordinates being fed.
In particular "base names is larger"
I saw a place where it was defined as empty. And a couple things that do some stuff, But I haven't figured out how it works well enough to try a thorough tracing it yet.
A smaller trace has actually confirmed that somehow:
The array is actually empty that it is supposed to be iterating on, Considering the broader context, I suspect that maybe a deleted file/method/piece is causing this? Or some other change either in how python works, or as a side effect of the 3.10 changes.
The text was updated successfully, but these errors were encountered: