Giter Club home page Giter Club logo

pyjhtdb's People

Contributors

ariellubonja avatar chichilalescu avatar dmedv avatar lowks avatar mschnau avatar mzwang2012 avatar petebachant avatar reggiethu2017 avatar rohitravoori avatar zzwz02 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  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  avatar  avatar  avatar

pyjhtdb's Issues

print spline polynomials

Add code to print spline polynomials in various formats, most importantly C/C# subroutines.
Also, for the case of y polynomials in the channel flow, put the coefficients in some format that can be ingested into a database. or something like that.
@KKanov, please take a minute to think about the format you'd like the polynomial coefficients to be put in, and let me know. Specifically, do you want a big multidimensional array, or just a 3D array for each MN pair?
(3D because there's y index, then neighbour index and then power of y).

following #26

the #26 now apparently works, the errors are gone. but the test fails and I"m afraid it is because the library has not been compiled

`Data is requested at time 2.0060000000000002
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\alex\Downloads\pyjhtdb\pyJHTDB\test.py", line 67, in test_plain
lTDB = pyJHTDB.libJHTDB()
File "C:\Users\alex\Downloads\pyjhtdb\pyJHTDB\libJHTDB.py", line 45, in init
os.path.abspath(os.path.join(lib_location, os.path.pardir)))
File "C:\Users\alex\Miniconda3\envs\pyjhtdb\lib\site-packages\numpy\ctypeslib.py", line 157, in load_library
raise OSError("no file with expected extension")
OSError: no file with expected extension

`

config file

at the moment the configuration file is "JHTDB_user_token.txt", and it's placed in the user's home folder, and it contains the authorization token.
this is most likely not good practice, but I'm not sure what would be, especially since we want this package to be as portable as possible.

Cannot build from source

Attempting to run python setup.py install gives

$ python setup.py install
running install
/home/pete/anaconda3/lib/python3.4/site-packages/setuptools-14.3-py3.4.egg/pkg_resources/__init__.py:2512: PEP440Warning: 'llvmlite (0.2.2-1-gbcb15be)' is being parsed as a legacy, non PEP 440, version. You may find odd behavior and sort order. In particular it will be sorted as less than 0.0. It is recommend to migrate to PEP 440 compatible versions.
running bdist_egg
running egg_info
writing pyJHTDB.egg-info/PKG-INFO
writing requirements to pyJHTDB.egg-info/requires.txt
writing top-level names to pyJHTDB.egg-info/top_level.txt
writing dependency_links to pyJHTDB.egg-info/dependency_links.txt
reading manifest file 'pyJHTDB.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'turblib/turblib.c'
warning: no files found matching 'turblib/soapC.c'
warning: no files found matching 'turblib/soapClient.c'
warning: no files found matching 'turblib/stdsoap2.c'
warning: no files found matching 'turblib/*.h'
warning: no files found matching 'turblib/*.nsmap'
writing manifest file 'pyJHTDB.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
running build_ext
building 'libJHTDB' extension
creating build/temp.linux-x86_64-3.4
creating build/temp.linux-x86_64-3.4/C
creating build/temp.linux-x86_64-3.4/turblib
gcc -pthread -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DCUTOUT_SUPPORT=1 -Iturblib -I/home/pete/anaconda3/include/python3.4m -c C/local_tools.c -o build/temp.linux-x86_64-3.4/C/local_tools.o
C/local_tools.c:38:21: fatal error: turblib.h: No such file or directory
 #include <turblib.h>
                     ^
compilation terminated.
error: command 'gcc' failed with exit status 1

I am on Linux Mint using Python 3.4 installed with Anaconda. Installing via pip works fine.

Kernel dies during retrieving

Hi.
Thank you for developing and maintaining this repo.
I've started using this but found that some examples are outdated and I couldn't find a proper usage.
With the script (see the bottom), I got a kernel shutdown.
When I run the script in Ipython, I got the following stack trace,

0: SOAP 1.2 fault: SOAP-ENV:Receiver [no subcode]
"System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Exception: JHTDB started using 1-based indexing from Sept 16. Please update your JHTDB library if you have not done so.
   at TurbulenceService.TurbulenceService.GetAnyCutoutWeb(String authToken, String dataset, String field, Int32 T, Int32 x_start, Int32 y_start, Int32 z_start, Int32 x_end, Int32 y_end, Int32 z_end, Int32 x_step, Int32 y_step, Int32 z_step, Int32 filter_width, String addr) in H:\Repos\Turbulence\Turbulence\WebSite\App_Code\WebService.cs:line 4860
   --- End of inner exception stack trace ---"
Detail: [no detail]

The script I use is as follows,

import numpy as np
from pyJHTDB import libJHTDB
from pyJHTDB.dbinfo import interpolation_code

auth_token  = "edu.jhu.pha.turbulence.testing-201311"  #Replace with your own token here
xstart, ystart, zstart = 1, 1, 1
xend, yend, zend = 8, 8, 8
xstep, ystep, zstep = 1, 1, 1
Filter_Width = 1
time_step = 1
field = 'u'
data_set = "isotropic1024coarse"

VarName="Velocity"
dim = 3
    
idx_x=np.arange(xstart, xend + 1, xstep)
idx_y=np.arange(ystart, yend + 1, ystep)
idx_z=np.arange(zstart, zend + 1, zstep)
nnx=np.size(idx_x)
nny=np.size(idx_y)
nnz=np.size(idx_z)

npoints=nnx*nny*nnz
split_no=int(np.ceil(npoints/(192000000/dim)))
result=np.zeros((nnz,nny,nnx,dim),dtype='float32')
tmp=np.array_split(np.arange(npoints).reshape(nnx,nny,nnz), split_no)

print(result.shape)

lJHTDB = libJHTDB()
lJHTDB.initialize()
lJHTDB.add_token(auth_token)

for t in range(split_no):
    xyzs0 = np.unravel_index(tmp[t][0,0,0], (nnx,nny,nnz))
    xyze0 = np.unravel_index(tmp[t][-1,-1,-1], (nnx,nny,nnz))
    xyzs1 = (idx_x[xyzs0[0]], idx_y[xyzs0[1]], idx_z[xyzs0[2]])
    xyze1 = (idx_x[xyze0[0]], idx_y[xyze0[1]], idx_z[xyze0[2]])
    
    temp = lJHTDB.getCutout(
        data_set=data_set, field=field,
        start=np.array([xyzs1[0], xyzs1[1], xyzs1[2]], dtype = np.int),
        # size=np.array([xyze1[0]-xyzs1[0]+1, xyze1[1]-xyzs1[1]+1, xyze1[2]-xyzs1[2]+1], dtype = np.int),
        step=np.array([xstep, ystep, zstep], dtype = np.int),
        filter_width=Filter_Width)
    
    result[xyzs0[2]:xyze0[2]+1, xyzs0[1]:xyze0[1]+1, xyzs0[0]:xyze0[0]+1,:] = temp
    
lJHTDB.finalize()
print(result.shape)

This is borrowed from DEMO_getCutout.ipynb, but some particular arguments, time and size are removed as it says they are (no longer) supported.

It would be appreciated if you could point me the proper usage.
Thank you in advance:)

Similar "fails to build wheel" issue to #26 and #27

I am using a Windows 10 device and anaconda to install.

I used "pip install pyJHTBD" and it failed saying

Failed to build pyJHTDB
Installing collected packages: pyJHTDB
Running setup.py install for pyJHTDB ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\67307\anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\67307\AppData\Local\Temp\pip-install-zue45wtf\pyJHTDB\setup.py'"'"'; file='"'"'C:\Users\67307\AppData\Local\Temp\pip-install-zue45wtf\pyJHTDB\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\67307\AppData\Local\Temp\pip-record-j9vpb34w\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\67307\anaconda3\Include\pyJHTDB'
cwd: C:\Users\67307\AppData\Local\Temp\pip-install-zue45wtf\pyJHTDB
Complete output (74 lines):
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
creating build\lib.win-amd64-3.7\pyJHTDB
copying pyJHTDB\dbinfo.py -> build\lib.win-amd64-3.7\pyJHTDB
copying pyJHTDB\generic_splines.py -> build\lib.win-amd64-3.7\pyJHTDB
copying pyJHTDB\interpolator.py -> build\lib.win-amd64-3.7\pyJHTDB
copying pyJHTDB\libJHTDB.py -> build\lib.win-amd64-3.7\pyJHTDB
copying pyJHTDB\misc.py -> build\lib.win-amd64-3.7\pyJHTDB
copying pyJHTDB\MortonIndex.py -> build\lib.win-amd64-3.7\pyJHTDB
copying pyJHTDB\test.py -> build\lib.win-amd64-3.7\pyJHTDB
copying pyJHTDB\test_data.py -> build\lib.win-amd64-3.7\pyJHTDB
copying pyJHTDB_init_.py -> build\lib.win-amd64-3.7\pyJHTDB
creating build\lib.win-amd64-3.7\pyJHTDB\data
copying pyJHTDB\data\channel_xgrid.npy -> build\lib.win-amd64-3.7\pyJHTDB\data
copying pyJHTDB\data\channel_ygrid.npy -> build\lib.win-amd64-3.7\pyJHTDB\data
copying pyJHTDB\data\channel_zgrid.npy -> build\lib.win-amd64-3.7\pyJHTDB\data
copying pyJHTDB\data\channel5200_ygrid.npy -> build\lib.win-amd64-3.7\pyJHTDB\data
copying pyJHTDB\data\transition_bl_ygrid.npy -> build\lib.win-amd64-3.7\pyJHTDB\data
running build_ext
building 'libJHTDB' extension
creating build\temp.win-amd64-3.7
creating build\temp.win-amd64-3.7\Release
creating build\temp.win-amd64-3.7\Release\C
creating build\temp.win-amd64-3.7\Release\turblib
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.25.28610\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT -Iturblib -Ic:\users\67307\anaconda3\include -Ic:\users\67307\anaconda3\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.25.28610\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" /TcC/local_tools.c /Fobuild\temp.win-amd64-3.7\Release\C/local_tools.obj
local_tools.c
C/local_tools.c(35): warning C4305: 'initializing': truncation from 'double' to 'float'
C/local_tools.c(66): warning C4244: '=': conversion from 'double' to 'float', possible loss of data
C/local_tools.c(78): warning C4244: '=': conversion from 'double' to 'float', possible loss of data
C/local_tools.c(82): warning C4244: '=': conversion from 'double' to 'float', possible loss of data
C/local_tools.c(83): warning C4244: '=': conversion from 'double' to 'float', possible loss of data
C/local_tools.c(84): warning C4244: '=': conversion from 'double' to 'float', possible loss of data
C/local_tools.c(140): warning C4244: '=': conversion from 'double' to 'float', possible loss of data
C/local_tools.c(151): warning C4244: '=': conversion from 'double' to 'float', possible loss of data
C/local_tools.c(155): warning C4244: '=': conversion from 'double' to 'float', possible loss of data
C/local_tools.c(156): warning C4244: '=': conversion from 'double' to 'float', possible loss of data
C/local_tools.c(157): warning C4244: '=': conversion from 'double' to 'float', possible loss of data
C/local_tools.c(203): warning C4244: '=': conversion from 'double' to 'float', possible loss of data
C/local_tools.c(214): warning C4244: '=': conversion from 'double' to 'float', possible loss of data
C/local_tools.c(218): warning C4244: '=': conversion from 'double' to 'float', possible loss of data
C/local_tools.c(219): warning C4244: '=': conversion from 'double' to 'float', possible loss of data
C/local_tools.c(220): warning C4244: '=': conversion from 'double' to 'float', possible loss of data
C/local_tools.c(223): warning C4244: '=': conversion from 'double' to 'float', possible loss of data
C/local_tools.c(184): warning C4101: 'valtmp': unreferenced local variable
C/local_tools.c(184): warning C4101: 'ztmp': unreferenced local variable
C/local_tools.c(184): warning C4101: 'xtmp': unreferenced local variable
C/local_tools.c(184): warning C4101: 'ytmp': unreferenced local variable
C/local_tools.c(184): warning C4101: 'rad0': unreferenced local variable
C/local_tools.c(184): warning C4101: 'stmp': unreferenced local variable
C/local_tools.c(306): warning C4244: '=': conversion from 'double' to 'float', possible loss of data
C/local_tools.c(313): warning C4244: '=': conversion from 'double' to 'float', possible loss of data
C/local_tools.c(289): warning C4101: 'valtmp': unreferenced local variable
C/local_tools.c(289): warning C4101: 'ztmp': unreferenced local variable
C/local_tools.c(289): warning C4101: 'xtmp': unreferenced local variable
C/local_tools.c(289): warning C4101: 'ytmp': unreferenced local variable
C/local_tools.c(289): warning C4101: 'stmp': unreferenced local variable
C/local_tools.c(289): warning C4101: 'bsize': unreferenced local variable
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.25.28610\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT -Iturblib -Ic:\users\67307\anaconda3\include -Ic:\users\67307\anaconda3\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.25.28610\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" /Tcturblib/turblib.c /Fobuild\temp.win-amd64-3.7\Release\turblib/turblib.obj
turblib.c
turblib/turblib.c(86): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
turblib/turblib.c(411): warning C4013: 'bzero' undefined; assuming extern returning int
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.25.28610\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT -Iturblib -Ic:\users\67307\anaconda3\include -Ic:\users\67307\anaconda3\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.25.28610\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" /Tcturblib/soapC.c /Fobuild\temp.win-amd64-3.7\Release\turblib/soapC.obj
soapC.c
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.25.28610\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT -Iturblib -Ic:\users\67307\anaconda3\include -Ic:\users\67307\anaconda3\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.25.28610\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" /Tcturblib/soapClient.c /Fobuild\temp.win-amd64-3.7\Release\turblib/soapClient.obj
soapClient.c
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.25.28610\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT -Iturblib -Ic:\users\67307\anaconda3\include -Ic:\users\67307\anaconda3\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.25.28610\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" /Tcturblib/stdsoap2.c /Fobuild\temp.win-amd64-3.7\Release\turblib/stdsoap2.obj
stdsoap2.c
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.25.28610\bin\HostX86\x64\link.exe /nologo /INCREMENTAL:NO /LTCG /nodefaultlib:libucrt.lib ucrt.lib /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:c:\users\67307\anaconda3\libs /LIBPATH:c:\users\67307\anaconda3\PCbuild\amd64 "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.25.28610\lib\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64" /EXPORT:PyInit_libJHTDB build\temp.win-amd64-3.7\Release\C/local_tools.obj build\temp.win-amd64-3.7\Release\turblib/turblib.obj build\temp.win-amd64-3.7\Release\turblib/soapC.obj build\temp.win-amd64-3.7\Release\turblib/soapClient.obj build\temp.win-amd64-3.7\Release\turblib/stdsoap2.obj /OUT:build\lib.win-amd64-3.7\libJHTDB.cp37-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3.7\Release\C\libJHTDB.cp37-win_amd64.lib
LINK : error LNK2001: unresolved external symbol PyInit_libJHTDB
build\temp.win-amd64-3.7\Release\C\libJHTDB.cp37-win_amd64.lib : fatal error LNK1120: 1 unresolved externals
error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.25.28610\bin\HostX86\x64\link.exe' failed with exit status 1120
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\67307\anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\67307\AppData\Local\Temp\pip-install-zue45wtf\pyJHTDB\setup.py'"'"'; file='"'"'C:\Users\67307\AppData\Local\Temp\pip-install-zue45wtf\pyJHTDB\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\67307\AppData\Local\Temp\pip-record-j9vpb34w\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\67307\anaconda3\Include\pyJHTDB' Check the logs for full command output.

You mentioned that this is a complex issue about the code. Just wondering whether you have find out where the problem is?

In #27, you mentioned about using zeep. In terms of using the code, Is that installing using Zeep the same compared with installing using Pip?

Installing through pip -- authkey configuration

I believe when installing through pip, we should be able add a flag to specify a specific auth-key. This prevents end-users from having to manage their own package and install from source. At least from the pip documentation, it is not immediately clear how to do this via pip. Via source, we can just change pyJHTDB/init.py

Is this already a way to do this? If not, how may I help implement this?

!pip install pyJHTDB ERROR (Google Colab env.)

Collecting pyJHTDB
Using cached pyJHTDB-20200909.0.tar.gz (386 kB)
error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
Preparing metadata (setup.py) ... error
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

Installation error (Windows, Python 3.5)

Hi,

Under Windows 7, I followed the installation procedure using pip (i.e., pip install pyJHTDB). I'm getting error messages during the compilation of stdsoap2.c, apparently linked to variable PyInit_libJHTDB not being recognized, as shown below. The same error occurs while building the wheel, and then at the lib build step.
Is there any known fix for this? Or, is there a different possibility to install the JHTDB Python package for Windows, that I should try?
Thank you in advance.

Benjamin

PS: the error messages:

Wheel step:

stdsoap2.c
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\1
4.14.26428\bin\HostX64\x64\link.exe /nologo /INCREMENTAL:NO /LTCG /nodefaultlib:
libucrt.lib ucrt.lib /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:D:\lecla
ire\Documents\WinPython-64bit-3.5.3.1Qt5\python-3.5.3.amd64\libs /LIBPATH:D:\lec
laire\Documents\WinPython-64bit-3.5.3.1Qt5\python-3.5.3.amd64\PCbuild\amd64 "/LI
BPATH:C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MS
VC\14.14.26428\lib\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.
0.17134.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.17
134.0\um\x64" /EXPORT:PyInit_libJHTDB build\temp.win-amd64-3.5\Release\C/local_t
ools.obj build\temp.win-amd64-3.5\Release\turblib/turblib.obj build\temp.win-amd
64-3.5\Release\turblib/soapC.obj build\temp.win-amd64-3.5\Release\turblib/soapCl
ient.obj build\temp.win-amd64-3.5\Release\turblib/stdsoap2.obj /OUT:build\lib.wi
n-amd64-3.5\libJHTDB.pyd /IMPLIB:build\temp.win-amd64-3.5\Release\C\libJHTDB.lib

LINK : error LNK2001: symbole externe non résolu PyInit_libJHTDB
build\temp.win-amd64-3.5\Release\C\libJHTDB.lib : fatal error LNK1120: 1 exter
nes non résolus
error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildT
ools\VC\Tools\MSVC\14.14.26428\bin\HostX64\x64\link.exe' failed with exi
t status 1120


Failed building wheel for pyJHTDB

Build step:

stdsoap2.c
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC

\14.14.26428\bin\HostX64\x64\link.exe /nologo /INCREMENTAL:NO /LTCG /nodefaultli
b:libucrt.lib ucrt.lib /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:D:\lec
laire\Documents\WinPython-64bit-3.5.3.1Qt5\python-3.5.3.amd64\libs /LIBPATH:D:\l
eclaire\Documents\WinPython-64bit-3.5.3.1Qt5\python-3.5.3.amd64\PCbuild\amd64 "/
LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools
MSVC\14.14.26428\lib\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\1
0.0.17134.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.
17134.0\um\x64" /EXPORT:PyInit_libJHTDB build\temp.win-amd64-3.5\Release\C/local
_tools.obj build\temp.win-amd64-3.5\Release\turblib/turblib.obj build\temp.win-a
md64-3.5\Release\turblib/soapC.obj build\temp.win-amd64-3.5\Release\turblib/soap
Client.obj build\temp.win-amd64-3.5\Release\turblib/stdsoap2.obj /OUT:build\lib.
win-amd64-3.5\libJHTDB.pyd /IMPLIB:build\temp.win-amd64-3.5\Release\C\libJHTDB.l
ib
LINK : error LNK2001: symbole externe non résolu PyInit_libJHTDB
build\temp.win-amd64-3.5\Release\C\libJHTDB.lib : fatal error LNK1120: 1 ext
ernes non résolus
error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Buil
dTools\VC\Tools\MSVC\14.14.26428\bin\HostX64\x64\link.exe' failed with e
xit status 1120

----------------------------------------

Command "D:\leclaire\Documents\WinPython-64bit-3.5.3.1Qt5\python-3.5.3.amd64\pyt
hon.exe -u -c "import setuptools, tokenize;file='D:\leclaire\AppData\Loca
l\Temp\pip-install-ypnhpjlg\pyJHTDB\setup.py';f=getattr(tokenize, 'open', op
en)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, _
file_, 'exec'))" install --record D:\leclaire\AppData\Local\Temp\pip-record-ue
c5zoke\install-record.txt --single-version-externally-managed --compile" failed
with error code 1 in D:\leclaire\AppData\Local\Temp\pip-install-ypnhpjlg\pyJHTDB

synchronize with new turblib

When the next version of the turbulence library is made available, there are a couple of things to take care of here:
--- bump the version number used in setup.py
--- uncomment "free_threshold_array" from local_tools.c (or use something else in the python code)
--- remove all the get[...]Soap function names from libJHTDB.getData, since they will no longer be needed (and the inconsistency with the web interface will go away).

basic_usage IPython notebook kills the kernel

Using the newest stable versions of Python 3.4, IPython from the Conda repositories, attempting to run all cells in basic_usage.ipynb kills the kernel. Top level tests.py script seems to run fine, though there is no output.

Host not found error during getPosition

Hi,
I am using the getPosition function on SciServer to retrieve tracks and the common problem is that the program shuts down with the following error:

0: SOAP 1.2 fault: SOAP-ENV:Sender [no subcode]
"Host not found"
Detail: get host by name failed in tcp_connect()

Thanks for providing and maintaining this software!

Kernel keep dying while using getCutout

Hi,

I was trying to retrieve the Channel velocity data by using getCutout method and it keeps killing the python kernel. We tested with default api getCutout as well and it does the same. I think this is related to issue#30 and I will appreciate your help. A simple MWE is given as follows;

velocity = lJHTDB.getCutout(
    data_set = 'channel',
    field='u',
    time_step=tidx,
    start = np.array([x0, y0, z0]),
    end  = np.array(cut_dims),
    step  = np.array([1, 1, 1]),
    filter_width = 1)  

I will appreciate your quick response.

Thanks!
EK

Jupyter Python kernels dying on multiple requests to channel dataset

Seems like the service should at least raise an exception instead of killing kernels. I am getting this issue with the channel flow dataset. I am requesting data at an existing point in the domain (according to the dataset info) for all times. Do these perhaps change with time? Is there a request to get a time averaged value of a given quantity at a given point in the domain?

0: SOAP 1.2 fault: SOAP-ENV:Receiver [no subcode]
"System.Web.Services.Protocols.SoapException: Server was unable to process reque
st. ---> System.Data.SqlClient.SqlException: OLE DB provider 'STREAM' for linked
 server '(null)' returned invalid data for column '[!BulkInsert].x'.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolea
n breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObj
ect stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand
 cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler,
TdsParserStateObject stateObj, Boolean& dataReady)
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cm
dHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, Tds
ParserStateObject stateObj)
   at System.Data.SqlClient.SqlBulkCopy.RunParser(BulkCopySimpleResultSet bulkCo
pyHandler)
   at System.Data.SqlClient.SqlBulkCopy.CopyBatchesAsyncContinuedOnSuccess(BulkC
opySimpleResultSet internalResults, String updateBulkCommandText, CancellationTo
ken cts, TaskCompletionSource`1 source)
   at System.Data.SqlClient.SqlBulkCopy.CopyBatchesAsyncContinued(BulkCopySimple
ResultSet internalResults, String updateBulkCommandText, CancellationToken cts,
TaskCompletionSource`1 source)
   at System.Data.SqlClient.SqlBulkCopy.CopyBatchesAsync(BulkCopySimpleResultSet
 internalResults, String updateBulkCommandText, CancellationToken cts, TaskCompl
etionSource`1 source)
   at System.Data.SqlClient.SqlBulkCopy.WriteToServerInternalRestContinuedAsync(
BulkCopySimpleResultSet internalResults, CancellationToken cts, TaskCompletionSo
urce`1 source)
   at System.Data.SqlClient.SqlBulkCopy.WriteToServerInternalRestAsync(Cancellat
ionToken cts, TaskCompletionSource`1 source)
   at System.Data.SqlClient.SqlBulkCopy.WriteToServerInternalAsync(CancellationT
oken ctoken)
   at System.Data.SqlClient.S

data integrity check

incorporate code that does sanity checks on data.
--- one version that does something automatic, and checks against some stored version of the pulled data
--- one version that puts together a bunch of plots that can be easily looked over

Error: soap struct not initialized

Hi,
I was trying to fetch whole data snapshots from JHTDB, and I found that with the getCutout() or getbigCutout() APIs I can only fetch 4096 elements at a time, so I tried to iterate through the indices and call the getbigCutout() multiple times.
However, I met this error when looping:
0: Error: soap struct not initialized
Can you tell me what caused this problem? Moreover, are there any easier way to download the full data snapshots from the database? Thanks,

Calling get_cutout() results in a server error page

Hello,

I'm trying to get cuts from the coarse isotropic dataset. I tried calling get_cutout(filename='/path/to/file', auth_token='my.auth.token'), letting most of the parameters stay as defaults. The URL it prints out looks like the following (shown here with the default auth token): http://turbulence.pha.jhu.edu/cutout/download.aspx/edu.jhu.pha.turbulence.testing-201302/isotropic1024coarse/u/0,1/0,16/0,16/0,16/

It then gives me an error that it was unable to open the downloaded HDF5 file (line 63 of cutout.py). I opened it in less and saw it was an HTML page. If I load the URL in a browser, it shows a server-side error with the following information:

Server Error in '/cutout' Application.

Could not load file or assembly 'HDF5DotNet.DLL' or one of its dependencies. The specified module could not be found.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'HDF5DotNet.DLL' or one of its dependencies. The specified module could not be found.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace: 


[FileNotFoundException: Could not load file or assembly 'HDF5DotNet.DLL' or one of its dependencies. The specified module could not be found.]
   System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0
   System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +457
   System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) +110
   System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +22
   System.Reflection.Assembly.Load(String assemblyString) +34
   System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +48

[ConfigurationErrorsException: Could not load file or assembly 'HDF5DotNet.DLL' or one of its dependencies. The specified module could not be found.]
   System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +729
   System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +247
   System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +157
   System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +226
   System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies() +73
   System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded) +321
   System.Web.Compilation.BuildManager.ExecutePreAppStart() +170
   System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +878

[HttpException (0x80004005): Could not load file or assembly 'HDF5DotNet.DLL' or one of its dependencies. The specified module could not be found.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +525
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +124
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +700

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.2053.0

Did I call get_cutout() incorrectly? Ultimately what I want to do is grab a large section of the data, e.g. 100 time steps of the full 1024^3 extent of the dataset.

add documentation

If one uses a single point, e.g. a 3-tuple as input, this will fail, but one could easily put this inside the function before checking for the proper shape:

points = np.asarray(points, dtype=np.float32)

Compile error under windows

Hello!

I am trying to install the package under Windows 10 using pip. I use Anaconda and I have a python 3.5 and 2.7 environment. In both of them I get the following error:

C/local_tools.c(319): error C2106: '=': left operand must be l-value

Any tips?

Server error when calling get_cutout()

I'm using get_cutout() in the following way:

lJHTDB = libJHTDB()
lJHTDB.initialize()
lJHTDB.add_token("my auth token")
...
result = lJHTDB.getCutout(data_set=dataset, field='u', time_step=time, start=start, end=end, step=step).astype(np.float32)
...
lJHTDB.finalize()

where time, start, end, and step are simple numpy arrays of type int32 with indices, and dataset is a string of the corresponding dataset. This is run inside some for loops for different indices and datasets.

Occasionally, I get the following server error:

0: SOAP 1.2 fault: SOAP-ENV:Receiver [no subcode]
"System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at TurbulenceService.Database.GetRawResults(IAsyncResult[] asyncRes, Byte[] result, Int32 components, Int32 X, Int32 Y, Int32 Z, Int32 T, Int32 Xwidth, Int32 Ywidth, Int32 Zwidth, Int32 Twidth, Int32[] serverX, Int32[] serverY, Int32[] serverZ, Int32[] serverT, Int32[] serverXwidth, Int32[] serverYwidth, Int32[] serverZwidth, Int32[] serverTwidth) in C:\Users\mwang93\Source\Repos\idies\Turbulence\Turbulence\TurbulenceWebServiceLibrary\Database.cs:line 2191
   at TurbulenceService.Database.GetRawData(DataSets dataset_enum, TableNames tableName, Int32 timestep, Int32 components, Int32 X, Int32 Y, Int32 Z, Int32 Xwidth, Int32 Ywidth, Int32 Zwidth) in C:\Users\mwang93\Source\Repos\idies\Turbulence\Turbulence\TurbulenceWebServiceLibrary\Database.cs:line 3776
   at TurbulenceService.Database.GetCutoutData(DataSets dataset_enum, TableNames tableName, Int32 tlow, Int32 components, Int32 xlow, Int32 ylow, Int32 zlow, Int32 Xwidth, Int32 Ywidth, Int32 Zwidth, Int32 x_stride, Int32 y_stride, Int32 z_stride, Int32 filter_width) in C:\Users\mwang93\Source\Repos\idies\Turbulence\Turbulence\TurbulenceWebServiceLibrary\Database.cs:line 3880
   at TurbulenceService.TurbulenceService.GetAnyCutoutWeb(String authToken, String dataset, String field, Int32 T, Int32 x_start, Int32 y_start, Int32 z_start, Int32 x_end, Int32 y_end, Int32 z_end, Int32 x_step, Int32 y_step, Int32 z_step, Int32 filter_width, String addr) in C:\Users\mwang93\Source\Repos\idies\Turbulence\Turbulence\WebSite\App_Code\WebService.cs:line 4918
   --- End of inner exception stack trace ---"
Detail: [no detail]

Unfortunately, I can't find a way to reliably reproduce it, it simple happens from time to time. Any idea what might the problem here?

Cutout storage ordering?

Original post:
Hi all.

First of all, thanks to all contributors who make this project possible, I highly appreciate it.

I have a short question:
I use getbigCutout() to create 1024*1024*1024*3 cutouts of the velocity filed from the isotropic1024coarse dataset in the form of hfd5 files.
I then read the hdf5 files in C, either the full field or by selecting a hyperslab in the hdf5 api.
It appears to me that the velocity field is stored in (z,y,x,i) oder rather than (x,y,z,i).
That means that when reading the full field, I need to transpose the array before accessing
element [i,j,k,l] as [((i*M + j)*M + k)*3 + l].
Selecting a hyperslab starting at (x,y,z) also requires transposition beforehand.

Now, is that expected behavior? If so, maybe it should be documented somewhere or exposed to the user?

I hope what I am saying makes sense.

Cheers,
Lukas

Edit:
Looking into libJHTDB.py, it does seem to be the case that the result is stored as (z,y,x,dim).
While I would prefer the ordering to be (x,y,z,dim)(C-style) or (dim,z,y,x) (Fortran), I assume there was reason to do it like this. Adding dimension scales to the hdf5 dataset could clarify any possible confusion of the user.

example ipython notebooks

I found out that ipython notebooks exist.
we should definitely have an example of pyJHTDB usage in that form...

Timeout error while running on SciServer

Hi,

I'm trying to run the following code on SciServer:

import numpy as np
from pyJHTDB import libJHTDB

lJHTDB = libJHTDB()
lJHTDB.initialize(exit_on_error=True)
lJHTDB.add_token(r'my-token-here') # commenting this line out does not seem to make a difference

while True:
    
    t = np.random.uniform(0,10.0)
    n_pts = 50
    x = np.random.uniform(0,2*np.pi,size=(n_pts,3))

    vel = lJHTDB.getData(t,point_coords=x.astype(np.float32), getFunction='getVelocity', sinterp='Lag4', tinterp='PCHIPInt')
    print('got velocity successfully')

It'll occasionally make it through the while loop successfully, but hasn't done so more than ~5 times before displaying the following error message:

0: SOAP 1.2 fault: SOAP-ENV:Receiver [no subcode]
"System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.InvalidOperationException: Timeout expired.  The timeout period elapsed prior to obtaining a connection from the pool.  This may have occurred because all pooled connections were in use and max pool size was reached.
   at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
   at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
   at System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry)
   at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
   at System.Data.SqlClient.SqlConnection.Open()
   at TurbulenceService.AuthInfo.LoadUserFromDatabase(String tokenString) in C:\Users\mwang93\Source\Repos\idies\Turbulence\Turbulence\TurbulenceWebServiceLibrary\AuthInfo.cs:line 78
   at TurbulenceService.AuthInfo.VerifyToken(String tokenString, Int32 reqsize) in C:\Users\mwang93\Source\Repos\idies\Turbulence\Turbulence\TurbulenceWebServiceLibrary\AuthInfo.cs:line 49
   at TurbulenceService.TurbulenceService.GetVelocity(String authToken, String dataset, Single time, SpatialInterpolation spatialInterpolation, TemporalInterpolation temporalInterpolation, Point3[] points, String addr) in C:\Users\mwang93\Source\Repos\idies\Turbulence\Turbulence\WebSite\App_Code\WebService.cs:line 82
   --- End of inner exception stack trace ---"

Thank you for any help!

fails to build a wheel on Windows 10 64 bit with Anaconda

Python 3.6

 Building wheel for pyJHTDB (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'C:\Users\alex\Miniconda3\envs\pyjhtdb\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\alex\\AppData\\Local\\Temp\\pip-req-build-r2cwfhgv\\setup.py'"'"'; __file__='"'"'C:\\Users\\alex\\AppData\\Local\\Temp\\pip-req-build-r2cwfhgv\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\alex\AppData\Local\Temp\pip-wheel-qlkzzye1' --python-tag cp36
       cwd: C:\Users\alex\AppData\Local\Temp\pip-req-build-r2cwfhgv\
  Complete output (75 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-3.6
  creating build\lib.win-amd64-3.6\pyJHTDB
  copying pyJHTDB\dbinfo.py -> build\lib.win-amd64-3.6\pyJHTDB
  copying pyJHTDB\generic_splines.py -> build\lib.win-amd64-3.6\pyJHTDB
  copying pyJHTDB\interpolator.py -> build\lib.win-amd64-3.6\pyJHTDB
  copying pyJHTDB\libJHTDB.py -> build\lib.win-amd64-3.6\pyJHTDB
  copying pyJHTDB\misc.py -> build\lib.win-amd64-3.6\pyJHTDB
  copying pyJHTDB\MortonIndex.py -> build\lib.win-amd64-3.6\pyJHTDB
  copying pyJHTDB\test.py -> build\lib.win-amd64-3.6\pyJHTDB
  copying pyJHTDB\test_data.py -> build\lib.win-amd64-3.6\pyJHTDB
  copying pyJHTDB\__init__.py -> build\lib.win-amd64-3.6\pyJHTDB
  creating build\lib.win-amd64-3.6\pyJHTDB\data
  copying pyJHTDB\data\channel_xgrid.npy -> build\lib.win-amd64-3.6\pyJHTDB\data
  copying pyJHTDB\data\channel_ygrid.npy -> build\lib.win-amd64-3.6\pyJHTDB\data
  copying pyJHTDB\data\channel_zgrid.npy -> build\lib.win-amd64-3.6\pyJHTDB\data
  copying pyJHTDB\data\channel5200_ygrid.npy -> build\lib.win-amd64-3.6\pyJHTDB\data
  copying pyJHTDB\data\transition_bl_ygrid.npy -> build\lib.win-amd64-3.6\pyJHTDB\data
  running build_ext
  building 'libJHTDB' extension
  creating build\temp.win-amd64-3.6
  creating build\temp.win-amd64-3.6\Release
  creating build\temp.win-amd64-3.6\Release\C
  creating build\temp.win-amd64-3.6\Release\turblib
  C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.15.26726\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Iturblib -IC:\Users\alex\Miniconda3\envs\pyjhtdb\include -IC:\Users\alex\Miniconda3\envs\pyjhtdb\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.15.26726\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\cppwinrt" /TcC/local_tools.c /Fobuild\temp.win-amd64-3.6\Release\C/local_tools.obj
  local_tools.c
  C/local_tools.c(35): warning C4305: 'initializing': truncation from 'double' to 'float'
  C/local_tools.c(66): warning C4244: '=': conversion from 'double' to 'float', possible loss of data
  C/local_tools.c(78): warning C4244: '=': conversion from 'double' to 'float', possible loss of data
  C/local_tools.c(82): warning C4244: '=': conversion from 'double' to 'float', possible loss of data
  C/local_tools.c(83): warning C4244: '=': conversion from 'double' to 'float', possible loss of data
  C/local_tools.c(84): warning C4244: '=': conversion from 'double' to 'float', possible loss of data
  C/local_tools.c(140): warning C4244: '=': conversion from 'double' to 'float', possible loss of data
  C/local_tools.c(151): warning C4244: '=': conversion from 'double' to 'float', possible loss of data
  C/local_tools.c(155): warning C4244: '=': conversion from 'double' to 'float', possible loss of data
  C/local_tools.c(156): warning C4244: '=': conversion from 'double' to 'float', possible loss of data
  C/local_tools.c(157): warning C4244: '=': conversion from 'double' to 'float', possible loss of data
  C/local_tools.c(203): warning C4244: '=': conversion from 'double' to 'float', possible loss of data
  C/local_tools.c(214): warning C4244: '=': conversion from 'double' to 'float', possible loss of data
  C/local_tools.c(218): warning C4244: '=': conversion from 'double' to 'float', possible loss of data
  C/local_tools.c(219): warning C4244: '=': conversion from 'double' to 'float', possible loss of data
  C/local_tools.c(220): warning C4244: '=': conversion from 'double' to 'float', possible loss of data
  C/local_tools.c(223): warning C4244: '=': conversion from 'double' to 'float', possible loss of data
  C/local_tools.c(184): warning C4101: 'valtmp': unreferenced local variable
  C/local_tools.c(184): warning C4101: 'ztmp': unreferenced local variable
  C/local_tools.c(184): warning C4101: 'xtmp': unreferenced local variable
  C/local_tools.c(184): warning C4101: 'ytmp': unreferenced local variable
  C/local_tools.c(184): warning C4101: 'rad0': unreferenced local variable
  C/local_tools.c(184): warning C4101: 'stmp': unreferenced local variable
  C/local_tools.c(306): warning C4244: '=': conversion from 'double' to 'float', possible loss of data
  C/local_tools.c(313): warning C4244: '=': conversion from 'double' to 'float', possible loss of data
  C/local_tools.c(289): warning C4101: 'valtmp': unreferenced local variable
  C/local_tools.c(289): warning C4101: 'ztmp': unreferenced local variable
  C/local_tools.c(289): warning C4101: 'xtmp': unreferenced local variable
  C/local_tools.c(289): warning C4101: 'ytmp': unreferenced local variable
  C/local_tools.c(289): warning C4101: 'stmp': unreferenced local variable
  C/local_tools.c(289): warning C4101: 'bsize': unreferenced local variable
  C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.15.26726\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Iturblib -IC:\Users\alex\Miniconda3\envs\pyjhtdb\include -IC:\Users\alex\Miniconda3\envs\pyjhtdb\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.15.26726\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\cppwinrt" /Tcturblib/turblib.c /Fobuild\temp.win-amd64-3.6\Release\turblib/turblib.obj
  turblib.c
  turblib/turblib.c(86): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
  C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\ucrt\string.h(337): note: see declaration of 'strncpy'
  turblib/turblib.c(411): warning C4013: 'bzero' undefined; assuming extern returning int
  C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.15.26726\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Iturblib -IC:\Users\alex\Miniconda3\envs\pyjhtdb\include -IC:\Users\alex\Miniconda3\envs\pyjhtdb\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.15.26726\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\cppwinrt" /Tcturblib/soapC.c /Fobuild\temp.win-amd64-3.6\Release\turblib/soapC.obj
  soapC.c
  C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.15.26726\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Iturblib -IC:\Users\alex\Miniconda3\envs\pyjhtdb\include -IC:\Users\alex\Miniconda3\envs\pyjhtdb\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.15.26726\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\cppwinrt" /Tcturblib/soapClient.c /Fobuild\temp.win-amd64-3.6\Release\turblib/soapClient.obj
  soapClient.c
  C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.15.26726\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Iturblib -IC:\Users\alex\Miniconda3\envs\pyjhtdb\include -IC:\Users\alex\Miniconda3\envs\pyjhtdb\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.15.26726\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\cppwinrt" /Tcturblib/stdsoap2.c /Fobuild\temp.win-amd64-3.6\Release\turblib/stdsoap2.obj
  stdsoap2.c
  C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.15.26726\bin\HostX86\x64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:C:\Users\alex\Miniconda3\envs\pyjhtdb\libs /LIBPATH:C:\Users\alex\Miniconda3\envs\pyjhtdb\PCbuild\amd64 "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.15.26726\lib\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.16299.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.16299.0\um\x64" /EXPORT:PyInit_libJHTDB build\temp.win-amd64-3.6\Release\C/local_tools.obj build\temp.win-amd64-3.6\Release\turblib/turblib.obj build\temp.win-amd64-3.6\Release\turblib/soapC.obj build\temp.win-amd64-3.6\Release\turblib/soapClient.obj build\temp.win-amd64-3.6\Release\turblib/stdsoap2.obj /OUT:build\lib.win-amd64-3.6\libJHTDB.cp36-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3.6\Release\C\libJHTDB.cp36-win_amd64.lib
  LINK : error LNK2001: unresolved external symbol PyInit_libJHTDB
  build\temp.win-amd64-3.6\Release\C\libJHTDB.cp36-win_amd64.lib : fatal error LNK1120: 1 unresolved externals
  error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.15.26726\\bin\\HostX86\\x64\\link.exe' failed with exit status 1120
  ----------------------------------------
  ERROR: Failed building wheel for pyJHTDB

How can I install the pyJHTDB under Windows

Sir,
It is really difficult to install it under the Windows 10 platform. Do you have any suggestion on it.
I use Anaconda and have tried pip, source code, to install the library, even copy to the site-package folder directly. But each method returns an Error either installing or importing.
Thank You

Installation with Anaconda

I installed pyJHTDB on Ubuntu 16.04 with Anaconda Python 3.6 (it includes h5py, numpy, sympy and scipy by default). If it's of interest for anyone, the steps are:

  1. Download Anaconda https://www.anaconda.com/download/#linux
  2. Install using bash Anaconda-latest-Linux-x86_64.sh
  3. Install pyJHTDB using pip and HDF5 library that is included in Anaconda (a part of h5py):
    pip install pyJHTDB --global-option=build_ext --global-option="-I/home/alex/anaconda3/include"
    note the path to the anaconda3 directory, replace it with your path.

Time info for channel flow is too short

Right now pyJHTDB.dbinfo.channel['time'][-1] equals to 6.6495004 and 'time' has only 1024 points whereas it should be 4 times more, up to 25.9935

I can use getData to get data for times up to 25.9935

Not compatible with latest NumPy due to use of `numpy.int`

Output of pip install pyjhtdb with NumPy 1.24.2:

Collecting pyjhtdb
  Using cached pyJHTDB-20200909.0.tar.gz (386 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [18 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/private/var/folders/s_/hs4wzl4j51d8tj7v6_cz5s3m0000gn/T/pip-install-hzls0x9p/pyjhtdb_28744e7f6d4545caa7e7ce8cb563e52d/setup.py", line 48, in <module>
          import pyJHTDB
        File "/private/var/folders/s_/hs4wzl4j51d8tj7v6_cz5s3m0000gn/T/pip-install-hzls0x9p/pyjhtdb_28744e7f6d4545caa7e7ce8cb563e52d/pyJHTDB/__init__.py", line 103, in <module>
          from .libJHTDB import *
        File "/private/var/folders/s_/hs4wzl4j51d8tj7v6_cz5s3m0000gn/T/pip-install-hzls0x9p/pyjhtdb_28744e7f6d4545caa7e7ce8cb563e52d/pyJHTDB/libJHTDB.py", line 38, in <module>
          class libJHTDB(object):
        File "/private/var/folders/s_/hs4wzl4j51d8tj7v6_cz5s3m0000gn/T/pip-install-hzls0x9p/pyjhtdb_28744e7f6d4545caa7e7ce8cb563e52d/pyJHTDB/libJHTDB.py", line 159, in libJHTDB
          start=np.array([0, 0, 0], dtype=np.int),
                                          ^^^^^^
        File "/Users/pete/mambaforge/envs/bl-turb-mod/lib/python3.11/site-packages/numpy/__init__.py", line 305, in __getattr__
          raise AttributeError(__former_attrs__[attr])
      AttributeError: module 'numpy' has no attribute 'int'.
      `np.int` was a deprecated alias for the builtin `int`. To avoid this error in existing code, use `int` by itself. Doing this will not modify any behavior and is safe. When replacing `np.int`, you may wish to use e.g. `np.int64` or `np.int32` to specify the precision. If you wish to review your current use, check the release note link for additional information.
      The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
          https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations. Did you mean: 'inf'?
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

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.