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

two problems when interacting with jupyter notebook #1

Open
ljzhou86 opened this issue Feb 15, 2018 · 3 comments
Open

two problems when interacting with jupyter notebook #1

ljzhou86 opened this issue Feb 15, 2018 · 3 comments

Comments

@ljzhou86
Copy link

Dear Sir,

Thanks for your sharing for the simulations of hot carrier cooling. These days, I am trying to reproducing the figure 2 and 3 and 4, I encounter two problems.

  1. when I run cells in "Polaron_effective_mass_theories.ipynb", jupyter gives me a warning "I couldn't find a kernel matching Julia 0.6.0. Please select a kernel:". I chose the python kernel, but it does not work. What's the kernel for you to match Julia?

  2. when I run all cells of "Polaron_cooling_via_heat_diffusion.ipynb", I got the following errors, could you help me to fix it? Thanks a lot.

TypeError Traceback (most recent call last)
in ()
2 fig = plt.figure(figsize=(10,10))
3 plt.plot(time_steps/1E-12,energy_MAPI,color="#d62728",ls="-",linewidth="2")
----> 4 plt.plot(time_steps/1E-12,energy_CsPbI3,color="purple",ls="--",linewidth="2")
5 plt.plot(time_steps/1E-12,energy_CdTe,color="#2ca02c",ls=":",linewidth="2")
6 plt.plot(time_steps/1E-12,energy_GaAs,color="#1f77b4",ls="-.",linewidth="2")

/scratch/ljzhou86/app/anaconda3/lib/python3.6/site-packages/matplotlib/pyplot.py in plot(*args, **kwargs)
3238 mplDeprecation)
3239 try:
-> 3240 ret = ax.plot(*args, **kwargs)
3241 finally:
3242 ax._hold = washold

/scratch/ljzhou86/app/anaconda3/lib/python3.6/site-packages/matplotlib/init.py in inner(ax, *args, **kwargs)
1708 warnings.warn(msg % (label_namer, func.name),
1709 RuntimeWarning, stacklevel=2)
-> 1710 return func(ax, *args, **kwargs)
1711 pre_doc = inner.doc
1712 if pre_doc is None:

/scratch/ljzhou86/app/anaconda3/lib/python3.6/site-packages/matplotlib/axes/_axes.py in plot(self, *args, **kwargs)
1435 kwargs = cbook.normalize_kwargs(kwargs, _alias_map)
1436
-> 1437 for line in self._get_lines(*args, **kwargs):
1438 self.add_line(line)
1439 lines.append(line)

/scratch/ljzhou86/app/anaconda3/lib/python3.6/site-packages/matplotlib/axes/_base.py in _grab_next_args(self, *args, **kwargs)
402 this += args[0],
403 args = args[1:]
--> 404 for seg in self._plot_args(this, kwargs):
405 yield seg
406

/scratch/ljzhou86/app/anaconda3/lib/python3.6/site-packages/matplotlib/axes/_base.py in _plot_args(self, tup, kwargs)
392 ncx, ncy = x.shape[1], y.shape[1]
393 for j in xrange(max(ncx, ncy)):
--> 394 seg = func(x[:, j % ncx], y[:, j % ncy], kw, kwargs)
395 ret.append(seg)
396 return ret

/scratch/ljzhou86/app/anaconda3/lib/python3.6/site-packages/matplotlib/axes/_base.py in _makeline(self, x, y, kw, kwargs)
299 default_dict = self._getdefaults(None, kw)
300 self._setdefaults(default_dict, kw)
--> 301 seg = mlines.Line2D(x, y, **kw)
302 return seg
303

/scratch/ljzhou86/app/anaconda3/lib/python3.6/site-packages/matplotlib/lines.py in init(self, xdata, ydata, linewidth, linestyle, color, marker, markersize, markeredgewidth, markeredgecolor, markerfacecolor, markerfacecoloralt, fillstyle, antialiased, dash_capstyle, solid_capstyle, dash_joinstyle, solid_joinstyle, pickradius, drawstyle, markevery, **kwargs)
394 self._us_dashOffset = 0
395
--> 396 self.set_linestyle(linestyle)
397 self.set_drawstyle(drawstyle)
398 self.set_linewidth(linewidth)

/scratch/ljzhou86/app/anaconda3/lib/python3.6/site-packages/matplotlib/lines.py in set_linestyle(self, ls)
1113 # compute the linewidth scaled dashes
1114 self._dashOffset, self._dashSeq = _scale_dashes(
-> 1115 self._us_dashOffset, self._us_dashSeq, self._linewidth)
1116
1117 @docstring.dedent_interpd

/scratch/ljzhou86/app/anaconda3/lib/python3.6/site-packages/matplotlib/lines.py in _scale_dashes(offset, dashes, lw)
67 scaled_offset = scaled_dashes = None
68 if offset is not None:
---> 69 scaled_offset = offset * lw
70 if dashes is not None:
71 scaled_dashes = [x * lw if x is not None else None

TypeError: can't multiply sequence by non-int of type 'float'

Best
Liujiang

@jarvist
Copy link
Member

jarvist commented Feb 20, 2018

  1. These are written in the Julia programming language - you will need to install a working instance:
    https://julialang.org/downloads/
    alternatively, if you don't want to install another programming language, you may be able to run them on the https://juliabox.com online server.

  2. These look like the typical errors you get in Python caused by dynamic typing. The most likely reason is that you are using a different version of Matplotlib compared to the one in which Lucy wrote the script. @lucydot - any ideas?

Hope this helps!

@lucydot
Copy link
Member

lucydot commented Feb 23, 2018

The script was written and runs fine for me using matplotlib 1.5.1 and Python 3.5

@lucydot
Copy link
Member

lucydot commented Feb 23, 2018

I was able to reproduce error 2 by updating to the latest version of matplotlib (2.1.2). The problem was with the linestyle options. I've fixed by removing linestyles from the plot, hopefully the latest commit should now work for you. Thanks for flagging this up -

Lucy

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

3 participants