CDAT / cdat

Community Data Analysis Tools
Other
174 stars 68 forks source link

old code issues with panel plots #2148

Open angshuiisc opened 7 years ago

angshuiisc commented 7 years ago

I am trying to plot a 4 panel figure. I am using my old code which used to work fine is now `

showing` following error :


Successfully updated your environment to use UVCDAT (changes are valid for this session/terminal only) Version: 2.4.1 Location: /usr/local/uvcdat/2.4.1 Reset these changes by running: source /usr/local/uvcdat/2.4.1/bin/reset_runtime.sh 0 2 Traceback (most recent call last): File "strat_cooling_4panel.py", line 289, in plot_4(plots, grids,titles,outname,k) File "strat_cooling_4panel.py", line 213, in plot_4 x.plot(plots[i],tmpl,meshobj,continents=0,yrev = 1) File "/usr/local/uvcdat/2.4.1/lib/python2.7/site-packages/vcs/Canvas.py", line 2404, in plot a = self.plot(arglist, keyargs) File "/usr/local/uvcdat/2.4.1/lib/python2.7/site-packages/vcs/Canvas.py", line 3726, in plot returned_kargs = self.backend.plot(*arglist, keyargs) File "/usr/local/uvcdat/2.4.1/lib/python2.7/site-packages/vcs/VTKPlots.py", line 605, in plot vtk_backend_grid, vtk_backend_geo, kargs)) File "/usr/local/uvcdat/2.4.1/lib/python2.7/site-packages/vcs/vcsvtk/pipeline2d.py", line 303, in plot self._plotInternal() File "/usr/local/uvcdat/2.4.1/lib/python2.7/site-packages/vcs/vcsvtk/isofillpipeline.py", line 253, in _plotInternal dataset_bounds=self._vtkDataSetBounds) File "/usr/local/uvcdat/2.4.1/lib/python2.7/site-packages/vcs/VTKPlots.py", line 760, in plotContinents contData = vcs2vtk.prepContinents(self.canvas._continentspath()) File "/usr/local/uvcdat/2.4.1/lib/python2.7/site-packages/vcs/vcs2vtk.py", line 555, in prepContinents f = open(fnm) TypeError: coercing to Unicode: need string or buffer, NoneType found


doutriaux1 commented 7 years ago

My guess is that your file name was read from a json files or something and as a result is Unicode not just string type.

Are your variables file variables? If so you might want to make them transient variables (v = v() )

Also when you open your file try: F=cdms2.open(str(filename)) it might fix the Unicode issue.

Sorry 2.4.1 is so old, it’s hard to support these sort of things.

I will try to reproduce your issue with 2.8

C.

From: angshuiisc notifications@github.com Reply-To: UV-CDAT/uvcdat reply@reply.github.com Date: Wednesday, January 4, 2017 at 9:52 PM To: UV-CDAT/uvcdat uvcdat@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: [UV-CDAT/uvcdat] old code issues with panel plots (#2148)

I am trying to plot a 4 panel figure. I am using my old code which used to work fine is now `

showing` following error :


Successfully updated your environment to use UVCDAT (changes are valid for this session/terminal only) Version: 2.4.1 Location: /usr/local/uvcdat/2.4.1 Reset these changes by running: source /usr/local/uvcdat/2.4.1/bin/reset_runtime.sh 0 2 Traceback (most recent call last): File "strat_cooling_4panel.py", line 289, in plot_4(plots, grids,titles,outname,k) File "strat_cooling_4panel.py", line 213, in plot_4 x.plot(plots[i],tmpl,meshobj,continents=0,yrev = 1) File "/usr/local/uvcdat/2.4.1/lib/python2.7/site-packages/vcs/Canvas.py", line 2404, in plot a = self.plot(arglist, keyargs) File "/usr/local/uvcdat/2.4.1/lib/python2.7/site-packages/vcs/Canvas.py", line 3726, in plot returned_kargs = self.backend.plot(*arglist, keyargs) File "/usr/local/uvcdat/2.4.1/lib/python2.7/site-packages/vcs/VTKPlots.py", line 605, in plot vtk_backend_grid, vtk_backend_geo, kargs)) File "/usr/local/uvcdat/2.4.1/lib/python2.7/site-packages/vcs/vcsvtk/pipeline2d.py", line 303, in plot self._plotInternal() File "/usr/local/uvcdat/2.4.1/lib/python2.7/site-packages/vcs/vcsvtk/isofillpipeline.py", line 253, in _plotInternal dataset_bounds=self._vtkDataSetBounds) File "/usr/local/uvcdat/2.4.1/lib/python2.7/site-packages/vcs/VTKPlots.py", line 760, in plotContinents contData = vcs2vtk.prepContinents(self.canvas._continentspath()) File "/usr/local/uvcdat/2.4.1/lib/python2.7/site-packages/vcs/vcs2vtk.py", line 555, in prepContinents f = open(fnm) TypeError: coercing to Unicode: need string or buffer, NoneType found


— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/UV-CDAT/uvcdat/issues/2148, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ACpw8cJPe3EE0cWEOyKzJ1ORFLQVJwEyks5rPIUDgaJpZM4LbXmE.

angshuiisc commented 7 years ago

Hi, cdms2.open(str(filename)) is not helping. i am getting the same error.

I have attached the code (in .zip) four_panel.py.zip

Thanks