Gudhi: The kernel appears to have died. It will restart automatically - python

import gudhi as gd
f= 'E:/PHD/persistance/image.txt'
# compute PH
md_cubical_complex = gd.CubicalComplex(perseus_file=f)
# result
md_cc_diag=md_cubical_complex.persistence()
pd_array=pdarray(md_cc_diag)
# filename
# write txt file
fout= 'E:/PHD/output' + filename + "_pd.txt"
np.savetxt(fout,pd_array,fmt='%1.6f')
whenever I try to run this code the following error occurs "The kernel appears to have died. It will restart automatically." i have tried many solutions mentioned on StackOverflow GitHub and Keras. Reinstalling libraries, creating new environments, changing the version of the library. kindly suggest a solution.
the code is not calculating cubical complexes and persistent homology.

Related

manim does not create an output file

If I run
python -m manimlib scene.py ket_bra
My scene renders fine into the interactive viewer, but I don't get any output file, the terminal prints the following
ManimGL v1.6.1
[13:55:48] INFO Using the default configuration file, which you can modify in `c:\users\miika\manim\manimlib\default_config.yml` config.py:323
INFO If you want to create a local configuration file, you can create a file named `custom_config.yml`, or run `manimgl --config` config.py:324
WARNING You may be using Windows platform and have not specified the path of `temporary_storage`, which may cause OSError. So it is recommended to specify the `temporary_storage` in the config file config.py:290
(.yml)
(process:3548): GLib-GIO-WARNING **: 13:55:49.613: Unexpectedly, UWP app `Clipchamp.Clipchamp_2.3.0.0_neutral__yxz26nhyzhsrt' (AUMId `Clipchamp.Clipchamp_yxz26nhyzhsrt!App') supports 46 extensions but has no verbs
If I add the parameter -p to the command then the interactive window remains blank and doesn't render the scene and in no case do I get an output file which is what I'm looking for and the terminal output is the same as before. Also if it's of note the background is grey, even tho it appears to be black in all samples that I can find. I have absolutely no idea what's going on as I can't find anybody else with a similar issue. I'm using windows 10 and v1.6.1 of 3b1b manim. The scene in this case is as follows (though this issue appears regardless of what the scene is)
from manimlib import *
class ket_bra(Scene):
def construct(self):
ket_q0 = Tex(r"|q_0\rangle")
ket_0 = Tex(r"|0\rangle")
ket_1 = Tex(r"|1\rangle")
ket_0_v2 = Tex(r"|0\rangle")
ket_1_v2 = Tex(r"|1\rangle")
ket_0_v3 = Tex(r"""|0\rangle=\begin{pmatrix}
1\\
0
\end{pmatrix}""")
ket_1_v3 = Tex(r"""|1\rangle=\begin{pmatrix}
0\\
1
\end{pmatrix}""")
bra_kets = VGroup(ket_q0, ket_0, ket_1).arrange(RIGHT, buff=1)
v_bra_kets = VGroup(ket_0_v2, ket_1_v2).arrange(RIGHT, buff=1.5)
bra_kets_def = VGroup(ket_0_v3, ket_1_v3).arrange(RIGHT, buff=1.5)
self.play(Write(ket_q0), Write(ket_0), Write(ket_1))
self.wait(0.5)
self.play(FadeOut(ket_q0))
self.play(Transform(ket_0, ket_0_v2), Transform(ket_1, ket_1_v2))
self.wait(1)
self.play(Transform(ket_0, ket_0_v3), Transform(ket_1, ket_1_v3))
Well I fixed the problem, without fixing the problem, I just switched to the community edition of manim and it works exactly as intended, so if you encounter the same problem and you're using 3b1b manim version, I reccomend just switching to the community version of manim, they are mostly functionally equivalent, but the community edition appears to be less buggy at least for me. Here's a super easy installation guide for it https://docs.manim.community/en/stable/installation/windows.html
However, I won't mark this as the best answer, because I didn't really solve the problem, and I still get the following warning and have no idea what it is. However, it appears to not affect functionality so it's fine, lol.
Windows Solution
Create TempLatex directory in C drive
Find manimlib/default_config.yml in the manim (manimgl version) directory and open it with a text editor
Modify line 18: before: temporary_storage: "" after: temporary_storage: "C:/TempLatex "
Save
From:
https://github.com/3b1b/manim/issues/1661#issuecomment-996575974

Neuroimaging 'nipype ' plugin not working

I was working on something an I this is actually my first time so things are not that clear for me yet, I ran this code :
pip install nipype
from nipype import Node, Workflow
from nipype.interfaces.fsl import SliceTimer, MCFLIRT, Smooth
slicetimer = Node(SliceTimer(index_dir=False,
interleaved=True,
time_repetition=2.5),
name="slicetimer")
mcflirt = Node(MCFLIRT(mean_vol=True,
save_plots=True),
name="mcflirt")
smooth = Node(Smooth(fwhm=4), name="smooth")
preproc01 = Workflow(name='preproc01', base_dir="dir_path")
preproc01.connect([(slicetimer, mcflirt, [('slice_time_corrected_file', 'in_file')]),
(mcflirt, smooth, [('out_file', 'in_file')])])
slicetimer.inputs.in_file = "file_path"
preproc01.run('MultiProc')
This is the error shown when I run the last line of code :
"Could not import plugin module: nipype.pipeline.plugins"
There is one more problem :
When I try to run this code :
preproc01.write_graph(graph2use='orig')
This is the error message shown :
'No command "dot" found on host. Please check that the corresponding package is installed.'
please if anyone knows the solution help me out.
BTW I an doing this from a video series, here is the link :https://www.youtube.com/watch?v=4FVGn8vodkc&t=4414s
Nipype showcase section.

python WMI screen brightness adjuster gets error 0x8004100c

I'm currently working on a script that creates a tray icon that allows the user to adjust screen brightness through menu options. The source code, written in python 3.6.8, can be found as a paste HERE. There seems to be an error message coming up when trying to select one of the brightness options, seen HERE. I did some reading and found that the error I'm getting (0x8004100c) refers to a feature or operation not being supported. Are there any workarounds available for this?
Thank you in advance.
code: https://pastebin.com/sLbyE9yb
error: https://pastebin.com/Xs7wHk73
WMI error reference: https://learn.microsoft.com/en-us/windows/win32/wmisdk/wmi-error-constants
gist: https://gist.github.com/imri0t/12e768e3d7e08734b85ae532d56090e1
(also if anyone can let me know if there's a way to keep the script from dying after an action is made it would be appreciated)
modules needed: pip install infi.systray / pip install wmi
code snip that I believe produces the error:
from infi.systray import SysTrayIcon
import wmi
def brightness_50(systray):
'''brightness: 50%'''
b = 50
c = wmi.WMI(namespace='root\\wmi')
br = c.WmiMonitorBrightnessMethods()[0]
br.WmiSetBrightness(3, b) #b will be a precentage / 100
menu = (("brightness: 100%", None, brightness_50))
systray = SysTrayIcon("icon.ico", "brightness", menu)
systray.start()

Issue running energyplus using eppy idf.run()

I'm having a problem running the following chunk of code in Jupyter Notebook:
i=[0,1,2,3]
from eppy.runner import run_functions
for i in i:
OA.Economizer_Control_Type = ECT[i]
idf1.saveas('C:/Users/mdahdolan/Dropbox/Work and Studies/Economizer
Study/Python/1A_Small_Office.idf')
print(OA.Economizer_Control_Type)
idf1.run(verbose='v')
and I'm getting this error:
om/bEI6B.jpg
You have issues with the path in the function saveas(), check that the route is available, exists and you can reach it without privileges ;)

Taking screenshot with python in linux (VM guest)

Following the answer to this similar stackoverflow question, I tried running this code
import gtk.gdk
w = gtk.gdk.get_default_root_window()
sz = w.get_size()
print "The size of the window is %d x %d" % sz
pb = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB,False,8,sz[0],sz[1])
pb = pb.get_from_drawable(w,w.get_colormap(),0,0,0,0,sz[0],sz[1])
if (pb != None):
pb.save("screenshot.png","png")
print "Screenshot saved to screenshot.png."
else:
print "Unable to get the screenshot."
However, the resulting image is completely black. My environment is linux mint 16 running in virtualbox on a mac. Was the black image the result of running a linux vm, or is there another reason?
It is the VM that is the issue here I'm pretty sure. At least it was for me.
There are several steps to figure out which part is messing up but most of them are with issues with the display on VM's having issues with the colormaps. so first
use:
gtk.gdk.colormap_get_system()
to get the colormap to use and replace the colormap in the original code. See if there's a change.
if that is a dead end I would suggest the following:
TURN OF YOUR VIDEO ACCELERATION <====Huge majority of issues fixed here
Roll Back then Update your video/graphics/3d drivers <==This is almost never the problem
Be sure you've got the newest release of pyscreenshot and retry screenshot
Let me know if it still isn't working and I'll send you the full Step-by-step (its quite long and jumps around a lot but it covers just about everything with this issue.)

Categories

Resources