Skip to content

Commit

Permalink
merging with master
Browse files Browse the repository at this point in the history
  • Loading branch information
scrgiorgio committed May 7, 2024
2 parents 644cad5 + bda22a1 commit bd2d7c7
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 72 deletions.
5 changes: 2 additions & 3 deletions Libs/swig/PyMultipleDataset.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,11 @@ For support : support@visus.net

namespace Visus {


inline String cstring(PyObject* value)
inline String convertToString(PyObject* value)
{
if (!value) return "";
PyObject* py_str = PyObject_Str(value);
const char* tmp = py_str ? PyUnicode_AsUTF8(py_str) : nullptr;
const char* tmp = py_str ? PyUnicode_AsUTF8(py_str) : nullptr; //cit "The caller is not responsible for deallocating the buffer."
String ret = tmp ? tmp : "";
Py_DECREF(py_str);
return ret;
Expand Down
1 change: 1 addition & 0 deletions Libs/swig/VisusPy.common
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ For support : support@visus.net

#include <Visus/Kernel.h>


static String convertToString(PyObject* value)
{
if (!value) return "";
Expand Down
7 changes: 7 additions & 0 deletions Libs/swig/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,7 @@ def Main(args):
os.chdir(this_dir)
ExecuteCommand([sys.executable, "Samples/python/array.py"],check_result=True)
ExecuteCommand([sys.executable, "Samples/python/dataflow/dataflow1.py"],check_result=True)
<<<<<<< HEAD

# broken
if not APPLE:
Expand All @@ -623,6 +624,12 @@ def Main(args):
ExecuteCommand([sys.executable, "-m","OpenVisus","server","--dataset","./datasets/cat/rgb.idx","--port","10000","--exit"],check_result=True)
ExecuteCommand([sys.executable, "Samples/python/test_api.py"],check_result=True)

=======
ExecuteCommand([sys.executable, "Samples/python/dataflow/dataflow2.py"],check_result=True)
ExecuteCommand([sys.executable, "Samples/python/idx/read.py"],check_result=True)
ExecuteCommand([sys.executable, "-m","OpenVisus","server","--dataset","./datasets/cat/rgb.idx","--port","10000","--exit"],check_result=True)
ExecuteCommand([sys.executable, "Samples/python/test_api.py"],check_result=True)
>>>>>>> master
sys.exit(0)

# test-full
Expand Down
43 changes: 41 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,45 @@ Convert to using a proxy:

- [docs/connect-proxy.md](./docs/connect-proxy.md).

Enable IDX2:
## VISUS_IDX2

- [docs/IDX2.md](./docs/IDX2.md).

Links:
- https://github.com/sci-visus/idx2.git

set `VISUS_IDX2` to "ON" in CMake.


Download a test file from here https://github.com/sci-visus/OpenVisus/releases/download/files/MIRANDA-DENSITY-.384-384-256.-Float64.raw

Setup your prompt:

```
SET PATH=%PATH%;C:\Python38;C:\Python38\Lib\site-packages\PyQt5\Qt\bin;build\RelWithDebInfo\OpenVisus\bin
SET VISUS_VERBOSE_DISKACCESS=0
SET VISUS_CPP_VERBOSE=0
```

Test pure IDX2, with IDX2 file format (not cachable, not cloud-ready)


```
set VISUS_USE_IDX2_FILE_FORMAT=1
rmdir /S /Q MIRANDA
visus.exe idx2 --encode "MIRANDA-DENSITY-.384-384-256.-Float64.raw" --name Miranda --field Density --dims 384 384 256 --type float64 --tolerance 1e-16 --num_levels 2 --out_dir .
visus.exe idx2 --decode Miranda/Density.idx2 --downsampling 1 1 1 --tolerance 0.001 --out_file test.raw
python Samples/python/extract_slices.py test.raw 193 193 129 float64
visusviewer.exe "MIRANDA/Density.idx2"
```

Then test using one-chunk per file (useful for CloudAccess, DiskAccess):
- you will see a lot of files, one per block/chunk

```
set VISUS_USE_IDX2_FILE_FORMAT=0
rmdir /S /Q MIRANDA
visus.exe idx2 --encode MIRANDA-DENSITY-.384-384-256.-Float64.raw --name Miranda --field Density --dims 384 384 256 --type float64 --tolerance 1e-16 --num_levels 2 --out_dir .
visus.exe idx2 --decode Miranda/Density.idx2 --downsampling 1 1 1 --tolerance 0.001 --out_file test.raw
python Samples/python/extract_slices.py test.raw 193 193 129 float64
visusviewer.exe "MIRANDA/Density.idx2"
```
66 changes: 0 additions & 66 deletions docs/IDX2.md

This file was deleted.

2 changes: 1 addition & 1 deletion scripts/cpython.windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -146,4 +146,4 @@ if [[ "$VISUS_GUI" == "1" ]]; then
popd
fi

echo "All done windows cpythyon $PYTHON_VERSION} "
echo "All done windows cpythyon $PYTHON_VERSION} "

0 comments on commit bd2d7c7

Please sign in to comment.