sharppy / SHARPpy

Sounding/Hodograph Analysis and Research Program in Python
https://sharppy.github.io/SHARPpy/index.html
Other
219 stars 112 forks source link

Cleaned up the decoders and merged some functionality #49

Closed tsupinie closed 9 years ago

tsupinie commented 9 years ago

Added new, cleaner decoders to the repository. This allowed me to merge the handling of observed vs. model soundings such that they're now loaded with the same code. That code also respects the format field in the XML now. The "Archive" option still loads using different code, and I have an idea for how to merge that, but that's for later. The "Archive" option now also reads bufkit soundings. (It's not clean, but it works).

I've also done some work to enhance the responsiveness of the GUI. Lots of the data requests generated when the user clicks on a drop down menu are done in separate threads so the GUI doesn't hang. It seems to work pretty well on Mac, but there's some magic in there that hopefully doesn't crash and burn on Windows or Linux.

There's one more thing I want to do, and it is fixing the break that occurs when you add a custom data source. After that, I think it can be cleaned up, tested, and released.

wblumberg commented 9 years ago

Found a bug with this most recent merge this morning. I tried to pull the final few profiles from the GFS run and SHARPpy freaked out. It didn't crash, but it threw an IndexError Exception and the progress bar had some funky numbers on it.

wblumberg commented 9 years ago

Also, this version seems a little slower on my computer when I load in an observed profile. And yes, I don't have a lot of tabs running.

tsupinie commented 9 years ago

The bugs with selecting non-contiguous profiles or sections of profiles that don't start at the initialization have been fixed in my latest push.

keltonhalbert commented 9 years ago

Still getting this issue. I'm going to try to dig into it.

Traceback (most recent call last): File "full_gui.py", line 77, in run ret_val = func(_args, *_kwargs) File "full_gui.py", line 605, in loadData profs = dec.getProfiles(indexes, prog) File "/Users/keltonhalbert/Downloads/SHARPpy-map-selector/sharppy/io/decoder.py", line 38, in getProfiles profs.append(ConvectiveProfile.copy(prof)) File "/Users/keltonhalbert/Downloads/SHARPpy-map-selector/sharppy/sharptab/profile.py", line 250, in copy return cls(new_kwargs) File "/Users/keltonhalbert/Downloads/SHARPpy-map-selector/sharppy/sharptab/profile.py", line 428, in init self.get_PWV_loc() File "/Users/keltonhalbert/Downloads/SHARPpy-map-selector/sharppy/sharptab/profile.py", line 848, in get_PWV_loc self.pwv_flag = pwv_climo(self, self.location, month=None) File "/Users/keltonhalbert/Downloads/SHARPpy-map-selector/sharppy/databases/pwv.py", line 146, in pwv_climo month_mean = float(pwv_means[month-1]) TypeError: 'NoneType' object has no attribute 'getitem**'

keltonhalbert commented 9 years ago

I located the issue. Will push change. It was in the PWV code itself.

keltonhalbert commented 9 years ago

So, after finally figuring out my issue with qt on linux, I can finally give a relevant bug report on how the map selector runs on Linux. It doesn't. :(

Traceback (most recent call last): File "full_gui.py", line 613, in win = MainWindow() File "full_gui.py", line 189, in init self.initUI() File "full_gui.py", line 206, in initUI self.view = self.create_map_view() File "full_gui.py", line 335, in create_map_view view = MapWidget(self.data_sources[self.model], self.run, self.async, width=800, height=500) File "/home/khalbert/Downloads/SHARPpy-map-selector/sharppy/viz/map.py", line 206, in init self.initMap() File "/home/khalbert/Downloads/SHARPpy-map-selector/sharppy/viz/map.py", line 219, in initMap self._county_path = self.mapper.loadBoundary('counties') File "/home/khalbert/Downloads/SHARPpy-map-selector/sharppy/viz/map.py", line 155, in loadBoundary bndy = self._loadShapefile('USCounties') File "/home/khalbert/Downloads/SHARPpy-map-selector/sharppy/viz/map.py", line 57, in _loadShapefile raise IOError('error reading shapefile %s.shp' % name) IOError: error reading shapefile USCounties.shp

tsupinie commented 9 years ago

I'm working on removing the basemap dependence in my copy, so that should fix the error there. And do something that should probably be done for this release, anyway.