Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Jan Caron
    @jan-car
    Welcome to the EMPyRe chatroom!
    Alexander Clausen
    @sk1p
    :wave:
    Jan Caron
    @jan-car
    :smile: Hello there!
    thibaud denneulin
    @thibaud.denneulin_gitlab
    Hi!
    Dieter Weber
    @uellue
    Hi :-)
    rafaldb
    @rafaldb
    ­čĹő­čĆ╗
    FENGSHAN95
    @FENGSHAN95
    Hello.
    Teresa We├čels
    @teresamw
    I am running a rather old version of Pyramid and I am running in trouble Matplotlib 3.1.0. Since I am fighting with package inconsistencies basically everywhere now, I wanted to set up a new set up a new enviroment for Pyramid and install a newer version of Pyramid. Could you point me to where I can find a newer Pyramid version to install?
    Jan Caron
    @jan-car
    Sorry for not answering earlier, I (and many other customers of Unitymedia/Vodafone) had severe internet problems yesterday and today. You can get the latest Pyramid version via the "pyramid-master" branch on Empyre. On the overview page, click on "master" and change your branch to "pyramid-master". I think you can then just clone or download the repository (now in pyramid "mode") and install ist via setup.py (I think it should be installable into the empyre environment you already have, if not, feel free to ask for further instructions)
    Teresa We├čels
    @teresamw

    Sorry for taking so long. I found a way to downgrade a couple of my packages so that the old Pyramid version worked again.

    I still tried to install the latest Pyramid version, but I am just running into issues. The first time, I created a environment with the same name of an old one I deleted before. Installing Pyramid using the setup.py worked. Then, I started to install all the packages Pyramid needs using conda. In the end, I run into this issue: Library not loaded: @rpath/libopenblas.dylib. Given that I am not such a great programmer, I tried to google the issue. One of the possible issues which was listed was that one should not reuse environment names. So, I created a new environment. This time, I installed all the essential packages using pip (numpy scipy matplotlib ipython pandas sympy nose) beforehand. Afterwards, I tried to run the setup.py. Now, I get this error message: "File "setup.py", line 20
    f'version = "{version}"\n' +".
    Do you have a suggestion what I am doing wrong?

    Teresa We├čels
    @teresamw
    It seems like something serious broke with my environments and I don't know how. The kernel died without any notivication why. I ended up installing a complete Anaconda version from a backup.
    Alexander Clausen
    @sk1p
    @teresamw Hmm, the new error message, can you paste that completely? For example on dpaste.de
    Teresa We├čels
    @teresamw
    @sk1p sorry, I cannot get the error messages anymore. When I rolled back to an Anaconda version from the update, I lost the environment as well.
    Alexander Clausen
    @sk1p
    @teresamw Okay, did it work this time to install?
    Teresa We├čels
    @teresamw
    @sk1p I wasn't brave enough to try again yet. I didn't want to risk loosing a working version of Pyramid another time and I wanted to at least analyse some of my data today. I think next time I will start with a installing Anaconda completely new. It was not the first time that strange things happened when I installed or upgraded packages.
    Jan Caron
    @jan-car
    Teresa, just to make sure, does everything work now after our chat yesterday? Or are there still problems?
    The error message you got (in setup.py with the print command) seems to stem from some incompatibility of older python versions with the f-string formatting (just a guess, if it appears again, make sure to take a screenshot). I recommend using conda to create the environment from the environment.yml file, the specified environment should work for both pyramid and empyre if I'm not mistaken.
    Teresa We├čels
    @teresamw
    I have a working version of Pyramid now.
    When I had the issues, I tried to have everything up to date in the environment. Looking back, I think the environment was not set up properly as I did not show up everywhere (next time I will make screen shots to show you what I mean). Maybe Pyramid was really installed somewhere else and not in the environment I wanted to be installed in.
    Teresa We├čels
    @teresamw
    @jan-car In the HOLO meeting, you showed some time ago an example code for Empyre and how to plot with it? Is that available in the Git? If yes, I coudd not find it. I would like to plot the magnetisation of a sample together with the mask.
    Teresa We├čels
    @teresamw
    field = emp.fields.create_vector_vortex(dim=(16,64,64))
    field_shape = emp.fields.create_shape_disc(dim=(16,64,64))
    field = field*field_shape
    emp.vis.mask3d(field)
    emp.vis.quiver3d(field,mode='arrow',ar_dens=2,new_fig=False)
    That is what I can do so far. Now, I would like to see the arrows inside the disk as well. And it would be great if the disk would be grey instead of red
    Jan Caron
    @jan-car
    Hi Teresa, can you show the output image you get?
    The demo only showcased 2D plots, you are interested in 3D plots, right?
    I can add the demo, it is not currently on GitLab.
    You should be able to drag & drop the image here to post it.
    Teresa We├čels
    @teresamw
    image.png
    I know that I can create the 3D plots using this: mlab.init_notebook('x3d')
    Jan Caron
    @jan-car
    In general, ParaView would do what you want from the get go, but you can also achieve this in mayavi. The mask function should get keyword arguments that are passed to the underlying contour3d function: emp.vis.mask3d(field, color=(0.5, 0.5, 0.5), opacity=0.5) Let me know if that helps, otherwise, we can skype later and find out together what works. If it does work, do you think these values should be set as defaults for the mask3d plot?
    Teresa We├čels
    @teresamw
    That is getting very close to what I had in mind :) Thank you! The only left question is how I can set the background color to white or transparent.
    The default is a tricky question. Personally, I will mostly plot a mask together with the magnetisation. Thus, it would make sense for me to have the transparent mask as the default. But if others plot the mask primary to check how the mask looks like, the current defaults would be better.
    Teresa We├čels
    @teresamw
    Especially considering that with the transparent grey mask, the mask and the background are both grey now.
    Jan Caron
    @jan-car

    You can create the mayavi figure yourself beforehand and use it in the plot, just use

    mlab.figure(size=(700, 750), bgcolor=(0.5, 0.5, 0.5), fgcolor=(0., 0., 0.))

    where you can set everything (white bg would be (1, 1, 1) I think). Afterwards you need to use the newfig parameter to prevent empyre from creating a new one:

    emp.vis.mask3d(field, color=(0.5, 0.5, 0.5), opacity=0.5, newfig=False)

    Teresa We├čels
    @teresamw
    image.png
    Perfect! That's what I was aiming for :)
    Jan Caron
    @jan-car
    :smile: perfect :thumbsup:
    Again, if anyone has suggestions about which of these parameters should be standards, please let me know!
    Teresa We├čels
    @teresamw
    Following the logic I think you are using for the new plot functions, the current version is the best. It just means that I have to get used to a new system which does not take care of everything for me as some plot options in Pyramid used to do :D
    Jan Caron
    @jan-car
    Yeah, the old pyramid functions were doing everything at once, but without transparency. So the tradeoff now is more lines of code, but you (and people reading your code afterwards) will know better what is going on.
    Teresa We├čels
    @teresamw
    Jan, could you remind me how to plot a 2d image of a 3d structure? I have to admit, I forgot how it works exactly.
    Alexander Clausen
    @sk1p
    FYI, I just opened https://iffgit.fz-juelich.de/empyre/empyre/-/issues/48 regarding the publication of the repository and documentation
    Dieter Weber
    @uellue

    Just a quick question: Why is Python restricted to >= 3.7? See https://iffgit.fz-juelich.de/empyre/empyre/-/blob/master/setup.cfg#L36

    Supporting 3.6 would make it much easier to use it in LiberTEM, see LiberTEM/LiberTEM#851

    Dieter Weber
    @uellue
    Is there an up-to-date example of empyre? https://iffgit.fz-juelich.de/empyre/empyre/-/blob/master/demos/Pyramid%20Notebook%20Example.ipynb seems to be from the time before restructuring and I couldn't figure out how to adapt it to the current state, and https://iffgit.fz-juelich.de/empyre/empyre/-/tree/master/tests doesn't seem to cover much of the code base.
    Dieter Weber
    @uellue
    Looking at https://docs.python.org/3/whatsnew/3.7.html, it doesn't seem that any of the changes intersect with empyre. For that reason: https://iffgit.fz-juelich.de/empyre/empyre/-/merge_requests/34