Coder Social home page Coder Social logo

nmrsim's Introduction

Click the "Launch Binder" link above to see how nmrsim can be used in Jupyter notebooks.

Documentation on Read the Docs

nmrsim

https://img.shields.io/pypi/v/nmrsim

nmrsim is a Python library for the simulation of solution-state nuclear magnetic resonance (NMR) spectra.

The project is inspired by the program WINDNMR by Hans Reich. The goal for Version 1.0 of nmrsim is to provide Python tools for the same types of simulations that WINDNMR did--first- and second-order simulation of spin-1/2 spin systems, plus simulation of some dynamic NMR (DNMR) lineshapes. A longer-term goal is to expand the toolset (e.g. to allow higher-spin nuclei, or new DNMR models).

Features

  • Class-based abstractions for NMR features (nmrsim.Multiplet; nmrsim.SpinSystem; nmrsim.Spectrum).
  • Convenience functions for quickly plotting simulation results (nmrsim.plt).
  • A lower-level API for more "hands-on" calculation of NMR spectra (e.g. functions for creating and solving spin Hamiltonians in nmrsim.qm).

Examples

See the documentation, or the notebooks in the Jupyter folder, for examples of typical use cases.

Installation

pip install nmrsim

See the Developer Page for details on installing a developer version into a virtual environment.

Contribute

See the Contributing to nmrsim page for details on how to contribute to the project. You don't have to have any particular expertise! If you've used (or tried to use) the library and have suggestions, you can make a valuable contribution.

nmrsim's People

Contributors

dependabot[bot] avatar sametz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

nmrsim's Issues

some hacking for ease of use and output

I have adapted the code so

  1. I have a function that builds spin system matrices from shifts, degeneracy and coupling
  2. I have modified the output routines so you can plot to a file
  3. I have added the ability to pass parameters to the plotting

Is it worth me converting these into pull requests

finally is it possible to isolate the lien components for each chemical shift so they can have different line widths (I could even imagine this being useful on a per multiple component level...

regards
gary

Sparse v0.11.0 breaks nmrsim.qm

Minimal bug report for now to alert users that sparse 0.11.0 broke the Hamiltonian calculations in nmrsim.qm. It appears to be typing-related. For now, pin your sparse version to <=0.10

numba TypingError

Describe the bug
The typing error appears every time that I run the code. This code is one of the examples of ' nmrsim Documentation'

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Google Colab '
  2. Click on 'Note book link '
  3. Scroll down to '4th cell'
  4. See error

Expected behavior
I expected to see the array of H.

Screenshots
image

Desktop (please complete the following information):

  • OS: [windows 10]
  • Browser [chrome]
  • Version [84.0.4147.135 (Official Build) (64-bit)]

**nmrsim:
image

Additional context
This error appears for 'SpinSystem' too.

matplotlib unexpected keyword argument

Running the demo Jupyter notebooks, the following type of error was seen when plotting "stick"-style plots:

/srv/conda/envs/notebook/lib/python3.7/site-packages/matplotlib/cbook/deprecation.py:107: MatplotlibDeprecationWarning: stem() got an unexpected keyword argument 'use_line_collection'. This will raise a TypeError in future versions.
  warnings.warn(message, mplDeprecation, stacklevel=1)

remove print statements in qm.py

Describe the bug
Print spam to standard output when qm._tm_cache is searching for the sparse matrix.

To Reproduce
Steps to reproduce the behavior:

import nmrsim
nmrsim.qm._tm_cache(3)

Expected behavior
Only print notices if the expected files are NOT found.

numba deprecation warnings

Use of the qm module spams numba deprecation warnings to standard output.

This has been fixed in the master branch of sparse: pydata/sparse#336

When there is a new sparse release, update nmrsim's requirements to use it.

nmrsim.discrete documentation errors

Is your request for a correction to the documentation?
If so, please indicate:

  • what the error is

The module docstring only lists the first three models (AB, AB2 and ABX). Also, positional arguments should probably be documented in order of position, but the order of Jax and Jbx for the ABX documentation is reversed.

  • where the issue is found (e.g. a specific page/section of the online documentation, or the module/function/class/method containing the docstring in question).

in nmrsim.discrete and in the online documentation generated from it

Broken binder views of jupyter demos

Any Jupyter notebooks that use the qm module seem to get a "No module named 'importlib_resources'" on import. The .yml file in the binder folder needs to be updated. Issue #8 needs to be taken into consideration as well when doing this.

Remove print spam from qm.py

Calls to nmrsim.qm.hamiltonian_sparse generate debugging spam statements:

From hamiltonian_sparse:
Lz is type: 
Lproduct is type: 

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.