Coder Social home page Coder Social logo

mushroomfire / mdapy Goto Github PK

View Code? Open in Web Editor NEW
53.0 53.0 5.0 65.4 MB

A simple and fast python library to handle the data generated from molecular dynamics simulations

Home Page: https://mdapy.readthedocs.io/

License: BSD 3-Clause "New" or "Revised" License

Python 94.81% C++ 4.92% Shell 0.26%
material-science molecular-dynamics taichi

mdapy's Issues

How to change font size and font style in plot_dispersion?

Hi developer,

I want to change line color, font size and font style in Phon.plot_dispersion. However I can only change line color via fig, ax = system.Phon.plot_dispersion(color='green') . I noticed that only few can be changed via this way:

help(system.Phon.plot_dispersion)

Help on method plot_dispersion in module mdapy.phonon:

plot_dispersion(units='THz', yticks=None, ylim=None, color=None, merge_kpoints=None) method of mdapy.phonon.Phonon instance
    This function can plot the phonon dispersion.
    
    Args:
        units (str, optional): units of frequency, selected in ['THz', '1/cm']. Defaults to "THz".
        yticks (list[float], optional): y axis ticks, such as [0, 10, 20]. Defaults to None.
        ylim (list[float], optional): y axis limitation, such as [0, 100]. Defaults to None.
        color (str | rgb turple, optional): line color, can be a str, such as 'r', '#729CBD', or a rgb turple, such as [125, 125, 125]. Defaults to None.
        merge_kpoints (list, optional): sometimes you want to merge two equalvalue points, such as [2, 3]. Defaults to None.
    
    Returns:
        tuple: (fig, ax) matplotlib figure and axis class.

But how to change font size and font style?

GLFW emitted errors - Cannot Set Swap Interval and Failed to Make Context Current

Hello,
I am reaching out to report an issue that I have encountered while working with mdapy GUI. I am facing the following errors:

  1. Cannot set swap interval without a current OpenGL or OpenGL ES context
  2. WGL: Failed to make context current: ......
    I would like to kindly request your assistance in resolving these errors. Thank you for your attention to this matter. I look forward to hearing from you soon.

GLIBC Compatibility Issue & Frame Selection for Thermodynamic Time Averaging

Hello,

I recently experimented with mdapy and have thoroughly enjoyed the experience. I was able to install it successfully via pip. However, I encountered an issue related to the glibc version dependency when trying to run some computations. It seems that both taichi and mdapy require a newer version of glibc, whereas my OS offers an older version that I can't upgrade immediately. Could you advise on any potential solutions or workarounds?

In addition, I have a multi-frame trajectory and am interested in performing thermodynamic time averaging over a specific frame range. While I am aware ovito provides such a functionality, I couldn't find a similar feature in the mdapy documentation (perhaps I might have overlooked it).

Below, I've included my installation details, the test script I used, and the associated error message for reference:

Installation:
Installing collected packages: pygments, pyarrow, mdurl, dill, markdown-it-py, rich, taichi, mdapy
Successfully installed dill-0.3.7 markdown-it-py-3.0.0 mdapy-0.8.9 mdurl-0.1.2 pyarrow-13.0.0 pygments-2.16.1 rich-13.5.2 taichi-1.6.0

Test Script:
import mdapy as mp
import numpy as np
import taichi as ti
import time

ti.init(arch=ti.cpu)

print(mp.version)

start_time = time.time()
system = mp.System('./mydump-nve.lammpstrj')
print("Time taken:", time.time() - start_time, "seconds.")
print(system.data)

start_time = time.time()
system.build_neighbor(rc=5., max_neigh=60)
print("Time taken:", time.time() - start_time, "seconds.")

start_time = time.time()
system.cal_centro_symmetry_parameter(N=12)
print("Time taken:", time.time() - start_time, "seconds.")

start_time = time.time()
system.cal_atomic_entropy()
print("Time taken:", time.time() - start_time, "seconds.")

#start_time = time.time()
#system.cal_atomic_temperature(amass=np.array([58.933, 58.693, 55.847, 26.982, 63.546]))
#print("Time taken:", time.time() - start_time, "seconds.")

print(system.data['atomic_temp'].mean()) # K

csp

error = abs(system.data['c_1'] - system.data['csp'])
print(error[error > 0.1], error.max())

error = abs(system.data['c_2'] - system.data['atomic_entropy'])
print(error[error > 0.1], error.max())

start_time = time.time()
system.write_dump()
print("Time taken:", time.time() - start_time, "seconds.")

Error: python test.py
[Taichi] version 1.6.0, llvm 16.0.0git, commit f1c6fbbd, linux, python 3.10.8
Traceback (most recent call last):
File "/data1/xitan/works/Interface_temp/EmimBF4/lmp/CPM_nemd_right/1.0V/case1/test.py", line 1, in
import mdapy as mp
File "/home/xitan/anaconda3/envs/xitan_conda/lib/python3.10/site-packages/mdapy/init.py", line 14, in
from .create_polycrystalline import CreatePolycrystalline
File "/home/xitan/anaconda3/envs/xitan_conda/lib/python3.10/site-packages/mdapy/create_polycrystalline.py", line 17, in
import _voronoi_analysis
ImportError: /lib64/libm.so.6: version `GLIBC_2.29' not found (required by /home/xitan/anaconda3/envs/xitan_conda/lib/python3.10/site-packages/_voronoi_analysis.cpython-310-x86_64-linux-gnu.so)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.