Giter Club home page Giter Club logo

mdsplus / mdsplus Goto Github PK

View Code? Open in Web Editor NEW
66.0 18.0 43.0 150.49 MB

The MDSplus data management system

Home Page: https://mdsplus.org/

License: Other

C 26.91% C++ 8.19% Shell 0.62% Fortran 1.70% Python 10.31% PostScript 0.01% Java 27.86% XSLT 0.03% Makefile 0.38% IDL 0.78% Prolog 0.18% HTML 0.60% MATLAB 0.08% LabVIEW 14.51% CSS 0.01% JavaScript 0.53% Standard ML 6.75% PHP 0.43% Tcl 0.01% NSIS 0.12%
data-management data-visualization data-processing fusion

mdsplus's Introduction

Build Status

We want to know who you are

The MDSplus developers want to know who you are. If you or your site is using MDSplus please fill the following survey. We promise not to share your contact information. Do not assume that other's from your institution have also filled this out, we will combine the results.

MDSplus User Survey.

Building MDSplus

Building from source manually

To build and install MDSplus on unix systems, you will need to obtain the MDSplus distribution from github either as a git repository or as a compressed tar file.

To clone the repositiory:

git clone https://github.com/MDSplus/mdsplus.git

This will create a directory mdsplus under your current default.

To download the tarball wget https://github.com/MDSplus/mdsplus/tarball/alpha

And then untar it (The exact filename will depend on the release version):

tar -xzf MDSplus-mdsplus-alpha_release-6-3-423-5-gca7f90d.tar.gz

To build the software do the following (See special notes below):

# mkdir build
# cd build
# <mdsplus-src-dir>/configure
# make

However this requires having all the needed libraries and packages installed and there are many different options to configure for building MDSplus. When MDSplus is built to generate releases for public distribution a deploy script is used which uses Docker to pull specially configured Docker images from https://hub.docker.com/r/mdsplus/docker/

Building using Dockerized build environment

You can build MDSplus for any of the linux and windows operatings systems without needing to install any special compilers or libraries. If you have the mdsplus source code and Docker installed on your linux system and your account has privileges to run docker then you can build MDSplus using a simple command:

# cd build
# <mdsplus-src-dir>/deploy/build.sh --os=fc25 --branch=<branch> \
--release=<version i.e. 7.99.100>

The above command will build the installer packages using the sources in <mdsplus-src-dir>/... for the operating system selected. The packages will be named based on the branch and version specified. Note the branch option is only used for naming the packages. It does not checkout or create a git branch. There are many more options to the build.sh script which you can see by typing:

# <mdsplus-src-dir>/deploy/build --help

You can find the available operating systems that you could specify for the --os= by doing a directory as follows:

# ls <mdsplus-src-dir>/deploy/os/*.opts

Who Uses MDSplus This map shows world fusion sites using MDSplus.
(Use the button in the browser to return to this page)

https://drive.google.com/open?id=1Lt3r3dnAtx79anaLarJkKb4l0s5RWpPn&usp=sharing


Special Notes

For D3D sites that want to build the MDSplus/d3d ptdata interface you must first define an envionment variable D3DLIB_PATH set to the directory containing the d3 access library, libd3. Then invoke configure as follows:

./configure --enable-d3d

You can build the Motif applications using the static libraries so that the binaries can be used on systems where Motif is not installed. To enable the use of static Motif libraries use the --enable-staticmotif flag:

./configure --enable-staticmotif

Certain optional packages installed on system may be incompatible with some or all of the MDSplus package. We will try to keep a list of potential problems found in this document along with possible workarounds.

F77 compiler problems:

If configure cannot locate an appropriate F77 compiler it will abort. If you have an F77 compiler then define the environment variable F77 to the binary for the compiler. If you don't have an F77 compiler, define environment variable NOF77 to yes and it will allow the configure to continue. You can build most of MDSplus without an f77 compiler.

LessTif conflicts:

  1. If the LessTif package is installed then configure will find it before it finds the real Motif package. LessTif is a marginal implementation of Motif and the MDSplus X applications will not build or run using LessTif package.

To build on a system with LessTif installed do the following:

setenv LD_LIBRARY_PATH [motif-lib-directory]:$LD_LIBRARY_PATH setenv UILPATH [motif-bin-directory-where-uil-image-is] ./configure --x-libraries=[motif-library-directory]
--x-includes=[motif-include-directory]

replacing the text inside the brackets (and the brackets) with the location of the real Motif files.

SYBASE Open/CLient - IDL database connection Sites with IDL, SYBASE Open/CLient libraries and Microsoft SQLSERVER databases can use idlsql library for database connectivity. The idl procedure in idl/Logbook/dbinfo.pro should be edited to reflect the site specific database connectivity and security policies. The default version assumes that the environment variable SYBASE_HOST contains the name of the host from the sybase interfaces file. It looks for a file $HOME/xxx.sybase_login, where xxx is the name of the sybase host, if it finds it and can read it, it sends the first line as the username and the second for the password, if not it sends $USER and a default password. NOTE - the environment variable SYBASE must point at the sybase distribution in order for their libraries to function. NOTE - if the sybase distribution is not /usr/local/sybase, configure will not find the distribution unless you first set the environment variable SYBASE to point the the distribution directory.

This extra line added to force a build

mdsplus's People

Contributors

alkhwarizmi avatar amicitas avatar andrearigoni avatar arewedreaming avatar bstandley avatar cenkoloji avatar dependabot[bot] avatar dgarnier avatar fluffynukeit avatar fmolon avatar gabrielemanduchi avatar herveancher avatar jdanz-psfc avatar joshstillerman avatar kgerickson avatar llnl-fesp avatar mdsplusbuilder avatar merlea avatar morgak avatar mwinkel-dev avatar orozda avatar santorofer avatar seanalsop avatar taliercio avatar tfredian avatar whobrokethebuild avatar wmarquesr avatar wuhao-thu avatar zack-vii avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mdsplus's Issues

MDSplus Python package is not installable by easy_install

Based on the documentation the Python bindings should be installable by executing:

easy_install MDSplus

This used to be the case, but since the end of December 2015 this is not working anymore. Example:

$ easy_install MDSplus
Searching for MDSplus
Reading https://pypi.python.org/simple/MDSplus/
No local packages or download links found for MDSplus
error: Could not find suitable distribution for Requirement.parse('MDSplus')

function return data types

Why do general purpose mdsplus data functions for matlab return non-general data types? For example, mdsconnect returns status having type MDSplus.Int32 rather than ordinary "int", mdsvalue returns java.lang.String rather than ordinary "string" when data is not found. Many standard matlab functions do not recognize these data types, which then requires writing special wrappers to convert these non-standard types into standard types. Why don't these functions just return standard types?

TreeNodeArrays from children_nids and member_nids do not preserve tree ref

import MDSplus
tree = MDSplus.Tree('test',-1,'new')
tree.addNode('A','STRUCTURE')
tree.write()
tree.quit()
tree = MDSplus.Tree('test',-1)
node = tree.top
nodes = node.getChildren()
print(nodes[0],node)
# tree holds the ref to tree -> ctx is valid
del(tree)
# node.tree still holds the ref to tree -> ctx is still valid
print(nodes[0],node)
del(node)
# nodes.tree only holds the pointer information in ctx -> ctx is invalid
print(nodes[0])

the del(tree) is similar to exiting a function returning 'nodes'. outside of the function the return value is broken.

Could anyone share the file "JavaGetAllFrames.fun" etc ?

According to the jScope Help Document,
"JavaGetAllFrames.fun", "JavaGetFrameTimes.fun", "JavaGetFrameAt.fun" are necessary for jScpe to display image. But in the installtion folder "...\tdi", there is no such file. So, could anyone share them with me?

treeshr's TreeSetUsage is broken

import MDSplus
t = MDSplus.Tree('test',-1,'new')
n=t.addNode('S','TEXT')
t.write()
t.quit()
t = MDSplus.Tree('test',-1,'edit')
s=t.getNode('S')
s.setUsage('SIGNAL')

throws

MDSplus.mdsExceptions.treeshrExceptions.TreeILLEGAL_ITEM: %TREE-E-ILLEGAL_ITEM, Invalid item code or part number specified

MdsGetMsg message ID 6 is returned but has no Message

Message 6 is undefined but returned when trying to write changes to a Tree while it is opened by another process.

Is the Message just missing or the return value wrong? Should be something like

%TREE-E-COULDNOTWRITE: Tree is opened by another process.

inconsistent datatype for dim_of when reading segmented data as block

If the dimension (dim_of) of a segment is not a floating point value array it will be type casted to Float64(D), However, not necessarily with Float64 accuracy.
e.g.: if dim is written as Uint32 the value 'V' will be returned as Float64(Float32(V)).

I assume this has been done to support different data types throughout the segments. However it is unlikely that the datatype changes thus it would be much better to conserve the shared datatype.

We save our times as ns since 1970 in Uint64. The typecasting can result in an error of days.
It is hidden most likely somewhere beyond TreeGetRecord.

MDSplus python returns an incorrect string class type when loading a list of strings

Save a list of strings to MDSplus and then load it. The join function works fine on the original list but has a type mismatch of string vs String on the list returned by MDSplus. One workaround is to type cast the MDSplus return value to str.

e.g. Adding this line between the getData() and the join in the example below lets the code work.
d = [str(s) for s in d]

c=['1','test','2','this is a']
print ":".join(c)
1:test:2:this is a
a.putData(c)
d=a.getData()
print d
["1", "test", "2", "this is a"]
print ":".join(d)
Traceback (most recent call last):
File "", line 1, in
TypeError: sequence item 0: expected string, String found

servershr/ServerSendMessage.c: Uninitialized var used

In servershr/ServerSendMessage.c, ServerSendMessage(), jobid is declared at line 144 and used on line 173 in an sprintf command whether or not it has been initialized on line 170. It is conditionally set based on the value of addr. jobid should be defined to be an invalid value so that in the case where addr is not set, the sprintf yields defined results. Further, better handling is needed in the case that addr is zero.

Twf use weakref for active tree #155 raises errors when tree ref is gone

Since TreeNode.tree is a proxy instead of a ref checking its validity using

TreeNode.tree is None

fails and the following use of tree in the Context of a Tree type will reise an error:

ReferenceError: weakly-referenced object no longer exists

In order to change tree to a weakref you need to either

use weakref.ref and replace each "read" appearance of TreeNode.tree with TreeNode.tree()

or change the condition "TreeNode.tree is None" to something that check if the proxy ist still valid

Can not work in matlab in Mac Yosemite

I have being using MDSplus in matlab on my Mac Maverick, evething is working.
But when I recently upgraded to Yosemite, it didn't work.
I tried the latest and the oldest stable release of MDSplus in both Matlab2015 and 2014 and getting the same error:

Error loading library javamds: java.lang.UnsatisfiedLinkError: /usr/local/mdsplus/lib/libJavaMds.dylib: dlopen(/usr/local/mdsplus/lib/libJavaMds.dylib, 1): Library not loaded: ../lib/libMdsShr.dylib
Referenced from: /usr/local/mdsplus/lib/libJavaMds.dylib
Reason: image not found
java.lang.UnsatisfiedLinkError: /usr/local/mdsplus/lib/libJavaMds.dylib: dlopen(/usr/local/mdsplus/lib/libJavaMds.dylib, 1): Library not loaded: ../lib/libMdsShr.dylib
Referenced from: /usr/local/mdsplus/lib/libJavaMds.dylib
Reason: image not found
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1965)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1890)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1880)
at java.lang.Runtime.loadLibrary0(Runtime.java:849)
at java.lang.System.loadLibrary(System.java:1088)
at MDSplus.Connection.(Connection.java:7)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:191)
at com.mathworks.jmi.OpaqueJavaInterface.findClass(OpaqueJavaInterface.java:181)

after i copied everything in the /usr/local/mdsplus/lib/ to ../lib/ the error is gone, but i always get ans=-1 when doing mdsconnect immediately, no timeout.

I also tried the objective way, I get the following error:

c=Connection('someipaddress')
Java exception occurred:
MDSplus.MdsException: Cannot connect to someipaddress
at MDSplus.Connection.(Connection.java:28)

this error comes up without delay, I am sure no network connection is even tried.
I think I followed the install instruction right since I was able to get it working on my Mac Maverick.

Maybe it's not an issue, but I really need to get it work.

Which library am I missing?

When I try to use the python bindings to my installation of the MDSplus libraries, I get the error that the connection can't be made, and there is some output that the TCP connection is not supported.

>>> import MDSplus
>>> MDSplus.Connection('atlas.gat.com:<port hidden>')
Protocol TCP is not supported
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/MDSplus/connection.py", line 142, in __init__
    raise Exception("Error connecting to %s" % (hostspec,))
Exception: Error connecting to atlas.gat.com:<port hidden>

I tracked down the "Protocol TCP is not supported" to mdsshr/librtl.c, but I can't tell what library it is looking for to know which library I am missing that I need to install.

mdstcl's do/method on python devices closes the tree parenting the device

assuming \TESTTREE::TOP:DEVICE_PATH is a device that has a method 'method(self,*arg)'
The new doMethod seems to still close all trees on return.
mdstcl is segfaulting on attempt to reopen tree.

TCL> set tree testtree
TCL> show db
000  testtree             shot: -1  [\TESTTREE::TOP]

TCL> do/method device_path method
TCL> show db

TCL> set tree testtree
Segmentation fault

wfevent crash on win64

A client running on win 64bits will crash on wfevent.fun once the event occurs.
Thereby the source of the event (remote/local, 32/64bit, win/unix) does not seem to play a role.
jScope works fine though. I suppose it has a direct link to the MDSplus event core.
Since MATLAB is also based on java, it might be caused by the TDI interface.

The python quantity None is not properly handled when stored to an MDSplus node

None is a valid python data value indicating that no specific value (other than None) has been assigned to a variable but the variable name has been created, exists and can be manipulated in code. The workaround is to choose default values like '' or -1 or similar magic values for variables that may or may not receive input or be assigned to at some point in the code. The ability to store some placeholder for None in MDSplus could result in cleaner code.


The python built-in class/value None is not handled properly when stored to an MDSplus tree node.


If the python value None is stored to a tree node by itself (use=ANY) then MDSplus throws an exception indicating that the node is empty.

a=st.getNode('SIGNAL4')
a.putData('Test')
print a.getData()
Test
c= None
a.putData(None)
print a.getData()
Traceback (most recent call last):
File "", line 1, in
File "/sw/python/python2.6/lib/python2.6/site-packages/MDSplus/treenode.py", line 475, in getData
return TreeGetRecord(self)
File "/sw/python/python2.6/lib/python2.6/site-packages/MDSplus/_treeshr.py", line 220, in TreeGetRecord
raise TreeNoDataException("No data stored in node %s" % (str(n),))
MDSplus._treeshr.TreeNoDataException: No data stored in node \OEDGE::TOP:SIGNAL4


If the Python None value is part of a list that is stored to a tree node then MDSplus throws an exception indicating that the data is corrupted.

c=[5.0,'test',8.0,None]
print c
[5.0, 'test', 8.0, None]
d='Test'
a.putData(d)
print a.getData()
Test
a.putData(c)
print a.getData()
Traceback (most recent call last):
File "", line 1, in
File "/sw/python/python2.6/lib/python2.6/site-packages/MDSplus/treenode.py", line 475, in getData
return TreeGetRecord(self)
File "/sw/python/python2.6/lib/python2.6/site-packages/MDSplus/_treeshr.py", line 222, in TreeGetRecord
raise TreeException(MdsGetMsg(status))
MDSplus._treeshr.TreeException: %TREE-E-TreeBADRECORD, Data corrupted: cannot read record

calling python functions from tdi does not support _variables

This is probably one for Tom.
The variable type "Ident" should not be passes as object of itself but its content.
Or in short: Variables should be evaluated (one layer) before sending to python.

_a=1
pytest(_a)

returns

"\<class \'MDSplus.ident.Ident'\>"

instead of

"<class 'MDSplus.mdsscalar.Int32'>"

Since the variable does not exist inside the python environment getting its value will fail.
The same holds for MDSplus.tdibuiltins.builtins_other.*, such as IF_ERROR. However, these could be buffered using:

_b=IF_ERROR(_a,*);pytest(_b)

pytest.py:

def pytest ( arg ):
    return str(type(arg))

jScope forgets bit clipping on refresh

When images refresh, jScope does not re-apply the pre-existing bit clip setting, causing 12 bit images to appear as contour-like stripes. Opening the color palette dialog and adjusting at least one setting (either the slider or the checkbox) is sufficent to apply the clipping, but it is not so convenient to do this manually for many images after each shot.

twf-fix-compress-again2 is no good

The fix #297 causes a segfault on put with our digitizers (ACQ132). they store signals with raw data of type WORD. Disabling compression or reverting this commit prevents the segfault. Segmented data does not get compressed at all, even with the right flags set.

What about jas-fix-compress-error-for-FS-minus-zero ?

Julia Interface

Julia is a high performance programming language targeted towards scientific computing. It has syntax similar to Python but with C like speed. I have begun to use it in my own research and an MDSplus interface would be very helpful.

This could potentially be easily implemented by leveraging Julia's built in C interoperability to wrap MDSplus's existing C interface

Fix version handling of all MDSplus python packages and add detailed show version command.

The device packages do not use the existing MDSplus release numbers so it is difficult to determine if the version installed is the most recent. The major, minor and release values as well as other information such as branch, release_tag, git commit, release date etc could be added to configure and then incorporated into code to be used with package building, show version etc.

Problem building mdsobjects/labview in current alpha branch.

No new alpha releases are currently being built do to a compile error in the mdsobjects/labview code. There is apparently a problem with the TreeNodeArray class implementation producing errors shown below. To view these errors you can try:

docker run --rm mdsplus/docker:build_rhel6 build alpha

snippet of some of the errors below

mdstreeobjectswrp.cpp: In function ‘MDSplus::Int32Array mdsplus_treenodearray_isNoWriteModel(void**)’:
mdstreeobjectswrp.cpp:2670:42: error: could not convert ‘treeNodeArrayPtr->MDSplus::TreeNodeArray::isNoWriteModel()’ from ‘MDSplus::Int8Array’ to ‘MDSplus::Int32Array’
return treeNodeArrayPtr->isNoWriteModel();
^
mdstreeobjectswrp.cpp: In function ‘MDSplus::Int32Array mdsplus_treenodearray_isNoWriteShot(void**)’:
mdstreeobjectswrp.cpp:2675:41: error: could not convert ‘treeNodeArrayPtr->MDSplus::TreeNodeArray::isNoWriteShot()’ from ‘MDSplus::Int8Array_’ to ‘MDSplus::Int32Array’
return treeNodeArrayPtr->isNoWriteShot();
^
mdstreeobjectswrp.cpp: In function ‘MDSplus::Int32Array mdsplus_treenodearray_isOn(void__)’:
mdstreeobjectswrp.cpp:2680:32: error: could not convert ‘treeNodeArrayPtr->MDSplus::TreeNodeArray::isOn()’ from ‘MDSplus::Int8Array_’ to ‘MDSplus::Int32Array’
return treeNodeArrayPtr->isOn();
^
mdstreeobjectswrp.cpp: In function ‘MDSplus::Int32Array mdsplus_treenodearray_isSetup(void**)’:
mdstreeobjectswrp.cpp:2685:35: error: could not convert ‘treeNodeArrayPtr->MDSplus::TreeNodeArray::isSetup()’ from ‘MDSplus::Int8Array
’ to ‘MDSplus::Int32Array’
return treeNodeArrayPtr->isSetup();
^
mdstreeobjectswrp.cpp: In function ‘MDSplus::Int32Array mdsplus_treenodearray_isWriteOnce(void**)’:
mdstreeobjectswrp.cpp:2690:39: error: could not convert ‘treeNodeArrayPtr->MDSplus::TreeNodeArray::isWriteOnce()’ from ‘MDSplus::Int8Array*’ to ‘MDSplus::Int32Array’
return treeNodeArrayPtr->isWriteOnce();

ssh connection on a Windows client

As Windows does not ship with a native ssh client, Windows ssh connections are no standard. MDSplus cannot connect from Windows or even crashes when trying to connect (e.g. by setting the environment variable '_path' to "ssh://::"). Is there already a workaround?
My suggestion adding a mdsip-client-ssh.bat in the system folder that uses a putty representation plink.exe ('http://the.earth.li/~sgtatham/putty/0.53b/htmldoc/Chapter7.html'). plink is very light weight <400KB and could be added to the MDSplus bundle.
But it seems to need a bit more changes in the C code in order to work, i.e. it is not just the call of "mdsip-client-ssh "

treeshr/TreeGetRecord.c use of uninit status

In TreeOpenDatafileR(), status will be returned as an undefined value if TreeGetVmDatafile returns NULL. I'd change it to default to some safe value, but I don't know what that safe value is. I assume zero is wrong.

MdsLib.c: dtype_length default return value

dtype_length() needs a default cause in the switch statement to handle when the dtype passed in isn't accounted for. Currently, len will be returned with an undefined value.

len(mdsarray) on 32-bit anaconda py3 fails.

The following with stable version of MDSplus python package causes the python session to crash.

from MDSplus import *

a = Uint64Array([0,1,2,3,4,5,6,7,8,9])

len(a)

This was reported a couple months ago via MDSplus bugzilla:

http://www.mdsplus.org/bugzilla/show_bug.cgi?id=60

I was able to reproduce it but have not tried to debug it. Unfortunately I do not look at the bugzilla reports frequently so put the issue here instead. I suggested the workaround:

len(a.data())

The len() function is currently implemented doing int(_tdishr.TdiCompile('size($)',(self,)).data()) in the Data() class. Not sure why that would cause python to crash but an easy workaround would be
to define len() in the Array class to return len(a.data()). This problem only seems to happen with anaconda py3 on 32-bit machines (Windows). It was tested on 64-bit anaconda and other versions of python and platforms with no issues.

jScope loading reversed color state

jScope has problems setting the reverse when loading a configuration file. it is not set in the global setup dialog and the first axis_1_1 still has a white background. the line color changes correctly.

MDS_IO_OPEN mode

in "treeshr" the parameter "mode" of function "MDS_IO_OPEN" is used strangely and does not result in the expected way.
It seems, the parameter sets the mod (chmod) of the created file.
The values range from 0777 (TreeOpen,l.861, TreeGetShotId,l.97, TreeAddNode,.l.689) to 0666 and 0664.
I see why is it sometimes 0664 and sometimes 0666? Is this intentional?
Why is 0777 used? It makes .tree, .datafile, .characteristics, and the shotid.sys file executable.

Further the mode is only applied to the file if the code is executed by a user with elevated privileges.
And even than the permission 0777 results only in 755 (-rwxr-xr-x).

I think the mechanism need some attention (777 -> 666). Especially, one would want to preserve the permissions when cleaning up a tree using TreeCleanDatafile.

python TdiExecute a python script causes stange error when decompiling

If you call a python tdi program from within python, Python becomes incapable of decompiling Signals.
The TDI script pytest.py:

import MDSplus
def pytest ( arg ):
    return str(type(arg))

The python input:

import MDSplus
sig=MDSplus.Signal([1,2,3],None,[1,2,3])
sig
MDSplus.TdiExecute("pytest(1)")
sig

The python output:

Python 2.7.3 (default, Mar 13 2014, 11:03:55)
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import MDSplus 
>>> sig=MDSplus.Signal([1,2,3],None,[1,2,3])
>>> sig
Build_Signal([1,2,3], *, [1,2,3])
>>> MDSplus.TdiExecute("pytest(1)")
"<class 'MDSplus.mdsscalar.Int32'>"
>>> sig
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/MDSplus-alpha_7.0.182-py2.7.egg/MDSplus/mdsdata.py", line 512, in decompile
    return _tdishr.TdiDecompile(self)
  File "/usr/local/lib/python2.7/dist-packages/MDSplus-alpha_7.0.182-py2.7.egg/MDSplus/_tdishr.py", line 47, in TdiDecompile
    return _ver.tostr(_TdiShrFun(TdiShr.TdiDecompile,"Error decompiling",expression))
  File "/usr/local/lib/python2.7/dist-packages/MDSplus-alpha_7.0.182-py2.7.egg/MDSplus/_tdishr.py", line 30, in _TdiShrFun
    arguments = [_C.pointer(descriptor(expression))]+parseArguments(args)+[_C.pointer(xd),_C.c_void_p(-1)]
  File "/usr/local/lib/python2.7/dist-packages/MDSplus-alpha_7.0.182-py2.7.egg/MDSplus/_descriptor.py", line 196, in __init__
    c_d.dscptrs[i]=_C.pointer(descriptor(value.args[i]))
  File "/usr/local/lib/python2.7/dist-packages/MDSplus-alpha_7.0.182-py2.7.egg/MDSplus/_descriptor.py", line 246, in __init__
    apd=descriptor(value.toApd())
  File "/usr/local/lib/python2.7/dist-packages/MDSplus-alpha_7.0.182-py2.7.egg/MDSplus/_descriptor.py", line 264, in __init__
    apd=descriptor_apd(_C.cast(_C.pointer(apd_a),_C.POINTER(_C.POINTER(descriptor))),len(value.descs))
  File "/usr/local/lib/python2.7/dist-packages/MDSplus-alpha_7.0.182-py2.7.egg/MDSplus/_descriptor.py", line 621, in __init__
    self.pointer=ptr
TypeError: incompatible types, LP_LP_descriptor instance instead of LP_LP_descriptor instance

expected output of sig:

Build_Signal([1,2,3], *, [1,2,3])

This is on Linux only since on windows is still does not even return from the Tdi call:
win64

Python 2.7.10 (default, May 23 2015, 09:44:00) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import MDSplus
>>> sig=MDSplus.Signal([1,2,3],None,[1,2,3])
>>> sig
Build_Signal([1,2,3], *, [1,2,3])
>>> MDSplus.TdiExecute("pytest(1)")

win32

Python 2.7.10 (default, May 23 2015, 09:40:32) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import MDSplus
>>> sig=MDSplus.Signal([1,2,3],None,[1,2,3])
>>> sig
Build_Signal([1,2,3], *, [1,2,3])
>>> MDSplus.TdiExecute("pytest(1)")

Builld_xxx vs Make_xxx

Could someone please layout the real difference between Make_ and Build_ (maybe programmatically)and re-evaluate the usage of "Build_" in tdishr/TdiDecompileR.c,line 248. I could not test it yet if this line is the cause for the following but my point is: When setting up an Action "Program" in an Action-Node it will always decompile to "Build_Program", even if "Make_Program" has been inserted (using jTraverser). However, for a simple program, the

Build_Program(*,"/codes/myprogram")

variant does not dispatch properly. I needed to add a variable (e.g. $SHOT), even if none is required by the program itself.

Make_Program(*,"/codes/myprogram " // $SHOT)

This was the only way preventing a translation to Build_Program. My intuition would expect it just the other way round.
Using "Do Action" from the jTraverser menu seemed to work in both cases. Nonetheless, only the "Make_" version is executed correctly via dispatching.

pypi packages unusable. Can't use bdist apparently. Perhaps just source tarballs

We used to just provide a url to mdsplus.org pointing to a directory python eggs and the python index (pypi) which is used by easy_install just worked. More recently it stopped working so we went to a scheme of uploading mdsplus python egg packages and that worked with easy_install but not with pip. Pip seems to only accept tar balls so instead of building python egg packages we switched the bdist distribution tarballs but this does not with easy_install either because it does not include the setup.py. Either packaging is invalid or it is necessary to just put a source tarball on pypi. Have to do more investigation and experimentation.

servershr/ServerQAction.c: Use of uninit var

The status returned from the ServerQAction function is not set in all case statements, particularly in SrvSetLogging, causing the return of an undefined value. status should be initialized to a reasonable value, either good or bad by default.

_treeshr.TreeException in tree.py

Someone needs to go through the python code again and replace all those old references to exceptions e.g. _treeshr.TreeException().
Since mdsExceptions.TreeException() accepts different inputs, this is not a trivial task. Most of the time customized messages are used. Best would be to define fixed messages for those, as well.

isSegmented flag is not set for segmented data

this way the check for segmented data using the Flags register or the MdsMisc->IsSegmented(nid) method will return wrong results. Is the flag something that is set during put / buildSegment or is it set dynamically?
I generated segmented data using pythons makeSegment(strt,stop,dim,data).
GenNumSegments returns the correct number of segments, reading the segments as block or one by one works as expected. However, only the slow GetNumSegments() function allows to identify the segmentation of the data.

python3 bytes vs. str

python 3 requires fix:
python 3 differentiates between str and bytes. however str(b'mybytes') does not convert to "mybytes" but "b'mybytes'" which corrupts the TDI interface (b'mybytes'.decode() does the conversion):

import MDSplus;MDSplus.TdiCompile('tdifun(_tdivar)')

returns

tdifun(b'_tdivar')

but should return

tdifun(_tdivar)

I am trying to find the issue in the python code somewhere in the interface between python and c

clean datafile on segmented data with getSegmentLimits

We experience problem with segmented data (images, shape per segment (1,2048,2048), i.e. one frame per segment) the segments have been written in parallel to other similar data. assumption the segments stored in the data file are not one continuous stream. If TCL command clean / python method cleanDatafile is used on the tree, the functionality of getSegmentLimits is broken. returning either None or [Cmplx($ROPRAND,$ROPRAND),Cmplx($ROPRAND,$ROPRAND)]. It happens on all 20 CYGNET4K frames on all shots. I am currently working on a reproducible example with less data. I will update on the results.

Had to rebase alpha.... be careful with pushes and merges....

Timo pointed out that the last push from Gabriele did ended up re-creating all of the changes since he last synced his local copy.

It came out in the history as a commit which changed three files followed by a merge that changed 128 files.

I pulled it all to my computer and then:
git rebase the-hash-before-this
then
git push -f

SO: You will need to pull or rebase before proceeding

-Josh

Issue with Windows 10/Python 3.5 64 bits

Using Windows 10 (or Windows Server 2012) with Python 3.5 64 bits, the ctypes seems to generate some memory access violation as shown below.

tree.getDefault()

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Anaconda3\lib\site-packages\mdsplus-7.0.61-py3.5.egg\MDSplus\mdsdata.py", line 523, in decompile
    return _mimport('_tdishr',1).TdiDecompile(self)
  File "C:\Anaconda3\lib\site-packages\mdsplus-7.0.61-py3.5.egg\MDSplus\_tdishr.py", line 103, in TdiDecompile
    status=TdiShr.TdiDecompile(_C.pointer(descriptor(value)),_C.pointer(xd),_C.c_void_p(-1))
OSError: exception: access violation writing 0x00000000D94AE540

It's working fine with older windows versions and/or older python versions as well as with Windows 10 + python 3.5 32 bits. It probably should be reported to the Python bug list, but I'm not able to produce a simple example (like https://bugs.python.org/issue17310) that could reproduce this bug.

Better documentation of multi-dimensional arrays in MDSplus

The layout of multi-dimensional arrays use a Fortran ordering. This is not documented on the wiki. Perhaps some examples in the tutorials should be added.

" When I do descr(type, data, dim1, dim2, dim3); mdsput(...) in C for a C-style array defined as int a[dim1][dim2][dim3], and I read it back out of mdsplus in any language (python, idl, c, etc), it comes out as int a[dim3][dim2][dim1]. So, for now, I'm just going to write it in reverse and hope for the best. But, it'd be good to have this documented somewhere, as this is fundamentally backwards for C and certainly not intuitive. The only documentation I found was a note that multidimensional recording was possible but not documented there:

http://www.mdsplus.org/documentation/tutorial/DataAccess.shtml"

python(3) setup.py test on windows

Running the setup.py test on any version on windows fails even if the test runs successful on unix systems. The output is shown below. I assume that the test contains some platform specific format or expression. Cleanup fails because some process in runTest (tests.treeUnitTest.treeTests) fails and does not release the files properly. (tested on Windows 10 64bit, python )

python 2.7 amd64
running test
running egg_info
writing MDSplus.egg-info\PKG-INFO
writing top-level names to MDSplus.egg-info\top_level.txt
writing dependency_links to MDSplus.egg-info\dependency_links.txt
reading manifest file 'MDSplus.egg-info\SOURCES.txt'
writing manifest file 'MDSplus.egg-info\SOURCES.txt'
running build_ext
Creating trees in m:\temp\tmponodvv
m:\temp\tmponodvv
runTest (tests.treeUnitTest.treeTests) ... ERROR
basicBinaryOperators (tests.dataUnitTest.dataTests) ... ok
mathFunctions (tests.dataUnitTest.dataTests) ... ok
tdiFunctions (tests.dataUnitTest.dataTests) ... ok
cleanup (tests.cleanup) ... [Error 32] The process cannot access the file because it is being used by another process: 'm:\\temp\\tmponodvv\\pytreesub_001.characteristics'
[Error 32] The process cannot access the file because it is being used by another process: 'm:\\temp\\tmponodvv\\pytree_001.tree'
[Error 32] The process cannot access the file because it is being used by another process: 'm:\\temp\\tmponodvv\\pytreesub_001.tree'
[Error 32] The process cannot access the file because it is being used by another process: 'm:\\temp\\tmponodvv\\pytree_002.tree'
[Error 32] The process cannot access the file because it is being used by another process: 'm:\\temp\\tmponodvv\\pytreesub_002.tree'
[Error 32] The process cannot access the file because it is being used by another process: 'm:\\temp\\tmponodvv\\pytreesub_002.characteristics'
[Error 32] The process cannot access the file because it is being used by another process: 'm:\\temp\\tmponodvv\\pytreesub_002.datafile'
[Error 145] The directory is not empty: 'm:\\temp\\tmponodvv'
ok

======================================================================
ERROR: runTest (tests.treeUnitTest.treeTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "i:\git\mdsplus\mdsobjects\python\tests\treeUnitTest.py", line 227, in runTest
    self.finish()
  File "i:\git\mdsplus\mdsobjects\python\tests\treeUnitTest.py", line 214, in finish
    self.pytree.deletePulse(self.shot+1)
  File "i:\git\mdsplus\mdsobjects\python\tree.py", line 265, in deletePulse
    _treeshr.TreeDeletePulse(self,shot)
  File "i:\git\mdsplus\mdsobjects\python\_treeshr.py", line 473, in TreeDeletePulse
    raise _mdsExceptions.statusToException(status)
MDSplusError: %MDSPLUS-E-Error, Failure to complete operation

----------------------------------------------------------------------
Ran 5 tests in 24.793s

FAILED (errors=1)

Windows python connection

Hi I quite the new GitHub and MDSplus user.
I am trying to connect to the MDSplus server through python and it doesn't seem to be working.

This is a copy of what I get

C:\Program Files\MDSplus>python
Python 2.7.10 |Anaconda 2.3.0 (64-bit)| (default, May 28 2015, 16:44:52) [MSC v.
1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://binstar.org

from MDSplus import *
Connection('192.168.1.11')
Connect failed, unknown host
Traceback (most recent call last):
File "", line 1, in
File "C:\Program Files\Anaconda\lib\site-packages\mdsplus-7.0_103-py2.7.egg\MD
Splus\connection.py", line 142, in init
raise Exception("Error connecting to %s" % (hostspec,))
Exception: Error connecting to 192.168.1.11

Unable to find tkvx4244.h

Hi... I was looking for VX4244 library.. I only found tkvx4244.c and DLL file.. But where is tkvx4244.h file which is mentioned in the include of tkvx4244.c file..

About matlab

os: window7x64sp1 simplechinese
matlab: 2013b
mdsplus: 6.1.62 x64 stable

There is no bug before update but after updata mdsplus from 2.3.0 to 6.1.62, two issues appears.

Q1: can't read data from server by mdsvalue, list as follow

mdsopen('115.156.252.250::jtext',1036669) % ('server::tree',shot_number)
Error: File: mdsopen.m Line: 12 Column: 11
Arguments to IMPORT must either end with ".*" or else specify a fully
qualified class name: "MDSplus.Data" fails this test.

mdsconnect('115.156.252.250')
Error: File: mdsconnect.m Line: 13 Column: 12
Arguments to IMPORT must either end with ".*" or else specify a fully
qualified class name: "MDSplus.Connection" fails this test.

Q2: link problem at visual studio 2010 (c++project)
1>mdswrite.obj : error LNK2019: unresolved external symbol _MdsValue,it used in function "int __cdecl get_signal_length(char const *)" (?get_signal_length@@YAHPBD@Z)
1>mdswrite.obj : error LNK2019: unresolved external symbol _descr,it used in function "int __cdecl get_signal_length(char const *)" (?get_signal_length@@YAHPBD@Z)
1>mdswrite.obj : error LNK2019: unresolved external symbol _MdsDisconnect,it used in function _main
1>mdswrite.obj : error LNK2019: unresolved external symbol _MdsClose,it used in function _main
1>mdswrite.obj : error LNK2019: unresolved external symbol _MdsOpen,it used in function _main
1>mdswrite.obj : error LNK2019: unresolved external symbol _MdsConnect,it used in function _main

Slicing in Python behaves like TDI rather than native/numpy arrays

Python (native and numpy) interprets the end index as the first element not included when slicing arrays, whereas TDI includes the end element (like IDL). Since indexing in mdsobjects (see __getitem__ in mdsdata.py) eventually calls TdiExecute, MDSplus arrays behave a bit unexpectedly:
>>> a = numpy.array([0.4, 0.5, 0.6, 0.7])
>>> b = MDSplus.Float32Array(a)
>>> a[0:2]
array([ 0.4, 0.5])
>>> b[0:2]
[.4,.5,.6]

I am happy to make a patch if you think it makes sense to fix it, probably by adjusting the end index in the aforementioned function.

@Gabriele

Hey you guys,

Its seems like you did a few merges without re-basing your branch first.
Therefore the merge will cover several iterations, making it harder to keep track of the changes.
It is fine for the web interface, however, it messes up the GitHub GUI interface.
Could someone clean this out before it reaches too far back?
It can be done by re-basing the MDSplus/alpha to the commit just prior to the first un-proper merge, i.e. 8c51533 , (mdsgetmsg.m: ...)

git rebase 8c51533

the merge will be faulty since it contains a few commits multiple times. It will pause to tell you. You can continue with

git rebase --continue

BTW: if you want to cherry-pick you can also use

git rebase -i 8c51533

where -i stands for interactive. this will open an editor where you can rearrange and modify commits.

If all went smoothly, you can push the new history with

git push origin +alpha

Thanks
cheers
-Timo

Bug in _TreeFindNodeWild with syntax such as .*** and :***

This bug may have been in MDSplus for a very long time but nobody used this search syntax before. That syntax started occurring mainly because of the way TreeNode.getNodeWild was implemented.

When the triple asterisk syntax is preceded by a period or colon, _TreeFindnodeWild seems to pass over some of the nodes multiple times sometimes causing the routine to return many more nodes than it should and in some cases infinitely recursing until the process runs out of memory.

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.