Thanks to visit codestin.com
Credit goes to github.com

Skip to content

xcpy: Interfacing with external scripts from Topspin#103

Merged
jjhelmus merged 24 commits into
jjhelmus:masterfrom
kaustubhmote:xcpy
Jul 10, 2019
Merged

xcpy: Interfacing with external scripts from Topspin#103
jjhelmus merged 24 commits into
jjhelmus:masterfrom
kaustubhmote:xcpy

Conversation

@kaustubhmote
Copy link
Copy Markdown
Collaborator

Bruker-Topspin now being freely available under an academic licence, this is a feature request that comes up often for me, and has popped up on the nmrglue-discuss group as well. The file xcpy.py, which is included in the nmrglue/util folder, will allow the use of nmrglue (and any other cpython script) from within Topspin. It is a lightly polished version of what has been sitting in one of my repositories for sometime now, and takes some suggestions from the nmrglue-discuss thread. This should go nicely with the ability of nmrglue to read and write (#85, #88) bruker datasets, and also with the philosophy of nmrglue of being the 'glue'. I am including a simple "Hello World" script as well (xcpy_test.py), but some real world examples can be found here.

The documentation on how to use this file are given in the file docstring itself. The TLDR version is:
Copy or symlink xcpy.py to the <topspin>/exp/stan/nmr/py/user directory, where is the directory where your topspin is located. If you now type xcpy or xcpy -h from within Topspin, the documentation should pop up and is hopefully self-explanatory regarding the various options and initial set up.

A simple GIF on how this should look like:

xcpy

This approach is, of course, not restricted to nmrglue; other programs like nmrpipe, matnmr, etc can all be accessed from within Topspin in a similar fashion (xcpy uses the subprocess module of the internal Jython to call an external script). I am inclined to start with just this, and see whether any bugs pop up before including other things in there. Currently, this is tested with Linux and Windows, and Topspin 3.6 and 4.0.

@jjhelmus
Copy link
Copy Markdown
Owner

@kaustubhmote This is really neat. I don't know they best location for this file in nmrglue but for the time being nmrglue/util seems fine.

@jjhelmus jjhelmus merged commit 50bc4a4 into jjhelmus:master Jul 10, 2019
@kaustubhmote
Copy link
Copy Markdown
Collaborator Author

Thanks! I actually thought I will have time for a couple of additions to improve the usability a bit before this is merged. I'll open a separate PR for that then.

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

Successfully merging this pull request may close these issues.

2 participants