Skip to main content

A python wrapper to unsio

Project description

ABOUT

UNSIO (Universal Nbody Snapshot Input Output) is an API which perform input/output operations in a generic way, and on different kind of nbody files format (nemo, Gadget binaries 1 and 2, Gadget hdf5, Ramses). By using this API, a user could write only one analysis program which will work on all known files format supported by UNSIO. It's not necessary anymore to know how is implemented a file format, UNSIO will do transparently and automatically all the hard work for you ! With UNSIO, you will spend less time to develop your analysis program. UNSIO comes with an integrated sqlite3 database which can be used to retrieve automatically all your data among terabytes of hard disks.

Features

UNSIO can be used from different languages (C,C++,Fortran and Python)

Supported files format :

Installing python wrapper from PYPI

pip install unsio -U

Installing the library for C/C++/Fortran

  • requirements :
    • hdf5 devel
    • sqlite3 devel
  • Build
    mkdir build
    cd build
    cmake .. 
    make -j 4 && make install
    

To get some python docstring help

python -m pydoc unsio.input
python -m pydoc unsio.output

Python example code

  • In the example below, we load a RAMSES simulation and we save it in GADGET3 file format
import unsio.input as uns_in  # unsio reading module

myfile="/home/jcl/output_00004" # input RAMSES simulation
# we instantiate a CUNS_IN object
my_in=uns_in.CUNS_IN(myfile,"gas,stars") # We select components GAS and STARS
#
# Reading
#
if my_in.nextFrame(): # load snapshot
  # read stars positions
  status,poss=my_in.getData("stars","pos")
  # read gas positions
  status,posg=my_in.getData("gas","pos")
  # read gas densities
  status,rho=my_in.getData("gas","rho")
  # read time simulation
  status,timex=my_in.getData("time")
#
# Writing
#
import unsio.output as uns_out # unsio writing module

myoutfile="snapshot.g3" # output file name
# we instantiate a CUNS_OUT object
my_out=uns_out.CUNS_OUT(myoutfile,"gadget3") # select gadget3 output format

# prepare data to be saved
# set time
status=my_out.setData(timex,"time")
# set stars positions
status=my_out.setData(poss,"stars","pos")
# set gas positions
status=my_out.setData(posg,"gas","pos")
# set gas densities
status=my_out.setData(rho,"gas","rho")

# write on file system
my_out.save()
# close
my_out.close()

License

UNSIO is open source and released under the terms of the CeCILL2 Licence

Webpage

Visit :

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

unsio-1.0.2.tar.gz (385.0 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

unsio-1.0.2-cp313-cp313-manylinux_2_28_x86_64.whl (3.7 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

unsio-1.0.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.3 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

unsio-1.0.2-cp313-cp313-macosx_15_0_arm64.whl (2.2 MB view details)

Uploaded CPython 3.13macOS 15.0+ ARM64

unsio-1.0.2-cp312-cp312-manylinux_2_28_x86_64.whl (3.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

unsio-1.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.3 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

unsio-1.0.2-cp312-cp312-macosx_15_0_arm64.whl (2.2 MB view details)

Uploaded CPython 3.12macOS 15.0+ ARM64

unsio-1.0.2-cp312-cp312-macosx_10_13_x86_64.whl (2.6 MB view details)

Uploaded CPython 3.12macOS 10.13+ x86-64

unsio-1.0.2-cp311-cp311-manylinux_2_28_x86_64.whl (3.7 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

unsio-1.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.2 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

unsio-1.0.2-cp311-cp311-macosx_15_0_arm64.whl (2.2 MB view details)

Uploaded CPython 3.11macOS 15.0+ ARM64

unsio-1.0.2-cp311-cp311-macosx_10_13_x86_64.whl (2.6 MB view details)

Uploaded CPython 3.11macOS 10.13+ x86-64

unsio-1.0.2-cp310-cp310-manylinux_2_28_x86_64.whl (3.7 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

unsio-1.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.2 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

unsio-1.0.2-cp310-cp310-macosx_10_13_x86_64.whl (2.6 MB view details)

Uploaded CPython 3.10macOS 10.13+ x86-64

unsio-1.0.2-cp39-cp39-manylinux_2_28_x86_64.whl (3.7 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ x86-64

unsio-1.0.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.2 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

unsio-1.0.2-cp39-cp39-macosx_15_0_arm64.whl (2.2 MB view details)

Uploaded CPython 3.9macOS 15.0+ ARM64

unsio-1.0.2-cp39-cp39-macosx_10_13_x86_64.whl (2.6 MB view details)

Uploaded CPython 3.9macOS 10.13+ x86-64

unsio-1.0.2-cp38-cp38-manylinux_2_28_x86_64.whl (3.7 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.28+ x86-64

unsio-1.0.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.2 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

unsio-1.0.2-cp38-cp38-macosx_10_13_x86_64.whl (2.6 MB view details)

Uploaded CPython 3.8macOS 10.13+ x86-64

File details

Details for the file unsio-1.0.2.tar.gz.

File metadata

  • Download URL: unsio-1.0.2.tar.gz
  • Upload date:
  • Size: 385.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for unsio-1.0.2.tar.gz
Algorithm Hash digest
SHA256 2383eb39a83ace745acf88a805bda478056b54bd4515cbfc931a01b163bb201f
MD5 e4d3d8fae41434834e3a019820dcfa5b
BLAKE2b-256 6fb8e89563375835f0a59cef900bd7acc9d718ecc9eeb3cd8e2da82de4a42553

See more details on using hashes here.

File details

Details for the file unsio-1.0.2-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for unsio-1.0.2-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 447b04e9a704a5aa61a6c641ebda800148650b548bc0408b55d7ec04ad75c178
MD5 adbc81ad7d23b36eb71369c39977b2d8
BLAKE2b-256 676e4f57faefedce5f440744dd568241fcf65ea0f0652e5af411c94f0bbcc8f1

See more details on using hashes here.

File details

Details for the file unsio-1.0.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for unsio-1.0.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4ea64a4fa4936537e74d3e85045d4674dd7097567484d705dc59abbfcbfd4859
MD5 91044468af97ecfc02d3376d57c6463b
BLAKE2b-256 002ca825c8bff3890f77e7df67d0e3ee95908dd4e8a1acc978851bffd376e27f

See more details on using hashes here.

File details

Details for the file unsio-1.0.2-cp313-cp313-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for unsio-1.0.2-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 4f34d66f78b51b8a223c14a4317ef99b1d35a3450a6917ad2d7e05b34fe77f2c
MD5 46034c3235cf67190ade33aa8430b185
BLAKE2b-256 0fbb2d421f808051efc645c62af71f688e18d76bc9a58efb66bad79dd38686ba

See more details on using hashes here.

File details

Details for the file unsio-1.0.2-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for unsio-1.0.2-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ed58ab2fd5bbd14a3da3281a49a3590becd68b566ffbc8f7b027e8ad88dde29f
MD5 4e4302f7d464715861b0826025c1702d
BLAKE2b-256 74d64a3b8cf82eb9530022918e250c3f97586e9db44c097469ca3d980e8b7df5

See more details on using hashes here.

File details

Details for the file unsio-1.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for unsio-1.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0a42a01f47240ce9ff0b1de06ff6a39ce33105bef8bc279180d4935c58f3b691
MD5 6ff8bd3ae621bf3b55aa008e5b593b61
BLAKE2b-256 ae2768db3ccf5356503e0ff560ad87a3dbb1325123e234e2a7aa09a61466e565

See more details on using hashes here.

File details

Details for the file unsio-1.0.2-cp312-cp312-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for unsio-1.0.2-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 405c533b24fb21fe276bdabdd97afaf6bdf3d72d1d36bc5985056ecc34621a63
MD5 cdd9414eddd709aaf98266f7ada09e34
BLAKE2b-256 541cc379a7165dc44d83b0d3eb2a0db88611038ebd7f762f1c9cc7bb505f79fe

See more details on using hashes here.

File details

Details for the file unsio-1.0.2-cp312-cp312-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for unsio-1.0.2-cp312-cp312-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 3ecb6840b244964244139f3e742ce441eb1a60a4d7f0923d66f956ae95024fbd
MD5 16a77a7c6bba7d5febbc592e20b0e078
BLAKE2b-256 f1017b88ddebccbea04f12bab8daaa98f9a3ebb879dd270711a8d4773adcd94e

See more details on using hashes here.

File details

Details for the file unsio-1.0.2-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for unsio-1.0.2-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9772c16e5c41ab5b9d9b66a4a6fc098c62ee4a01c5b56e3e866603b7a20bc2cc
MD5 fd84aa11d1a51a28d1c08d3a18f03108
BLAKE2b-256 af3dd102d6385062854f2f3d75aa0197b97603db7a6dc5e8b37e05fb30dfbeef

See more details on using hashes here.

File details

Details for the file unsio-1.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for unsio-1.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c1b4b03f3468eaa562d1b461ef28d59a71ab69f7b4eb836d0da55e8925157b5d
MD5 debd7d98bfe7b87fafd0060588b595ed
BLAKE2b-256 b56e4c86d83de0105901d05aed3a70f366864babc3bd7ad825f5177c3950d01c

See more details on using hashes here.

File details

Details for the file unsio-1.0.2-cp311-cp311-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for unsio-1.0.2-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 af4152e95ed70742f5cf55a5a81581e30e2e7a31b74f023cbf73f5cac91959b6
MD5 ff5cca4d142fa6cf1fb6d657eaf60beb
BLAKE2b-256 c0d4939bd63b94f25f04979de0cc08f89c340bcb00acc066d49763f23be91764

See more details on using hashes here.

File details

Details for the file unsio-1.0.2-cp311-cp311-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for unsio-1.0.2-cp311-cp311-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 568dc5c35d0658b901ff6f8e227666884e92d8c5d9a11f9de0b3623a2c343bbf
MD5 03f1bf8a5905a4b0ecc3ca80b7111b29
BLAKE2b-256 95084f71399497a369b96252b9b1d5eff6a93f3e082539929b49f1dc91d92a80

See more details on using hashes here.

File details

Details for the file unsio-1.0.2-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for unsio-1.0.2-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b7f32cdbe9e85b5abc331e512ea1cbf4ec5a73460c4ad9217009309bcc72a17e
MD5 d3fa7918521e2206e2d4defff6c2939e
BLAKE2b-256 dceccee8b0749b6caa5098d00075333536e823ce78768aeae7fba00c2222034b

See more details on using hashes here.

File details

Details for the file unsio-1.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for unsio-1.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 40fc538ebf39c96903ef7dbe43fbcac0cc205046e6f9b10767752e60194a3e6c
MD5 7cb634edcbf1c3885f6b073328ad00f2
BLAKE2b-256 354e17c8044d141a5259bd166cf09bf5bccbbfe118ed3a6c9a22078547e23faa

See more details on using hashes here.

File details

Details for the file unsio-1.0.2-cp310-cp310-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for unsio-1.0.2-cp310-cp310-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 ee79a63e7f6992685293f294f09be042a5eee58bcb3272553bf5de101d8b2ba8
MD5 2ca1d32d10147c4c6c9549bf310314b9
BLAKE2b-256 d16b57902e44e3ee01b8afaa4237fc10e93c9fc4a88c8fa1a7fb9fc408f8a6b7

See more details on using hashes here.

File details

Details for the file unsio-1.0.2-cp39-cp39-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for unsio-1.0.2-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b0e28ef85a410fc3a0a2539792f2bfda6a1a463d0e2c713443b87c0282ff022c
MD5 da5f381175638c41bb581f1557b7ef7c
BLAKE2b-256 fbf6b6c9e8148b8895c9bdd1ca92c307dca669e7e75489824e32ead88274abed

See more details on using hashes here.

File details

Details for the file unsio-1.0.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for unsio-1.0.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 53d46e2d9693478b03b6515fb9c9c0bf49c160c03ede711b01f41470de67aacf
MD5 e135f62329aac8cdb0855018147b5fa4
BLAKE2b-256 2cfa587b0844654ad4caf81a1eb4a77103270270de13f1c4b7e1e32c89043006

See more details on using hashes here.

File details

Details for the file unsio-1.0.2-cp39-cp39-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for unsio-1.0.2-cp39-cp39-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 ce5f9532922fe7a3c4a72bdb318e40ecd21dc522717a289e09567ea3b5b4c551
MD5 cb470faede0389205412948ef8d1dec7
BLAKE2b-256 e1ea5207d3cc08f0a8496a093c10bb221dc33d9d4c0e4bf946dbe04e1b30837f

See more details on using hashes here.

File details

Details for the file unsio-1.0.2-cp39-cp39-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for unsio-1.0.2-cp39-cp39-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 240b512e810b3ef93fed09f82a525b3588d4b92e82b76456058d60e2e6d16123
MD5 4cda078404a0736065b5807c2d6c8b79
BLAKE2b-256 7690e0b50afc370f55c6b3d81ae50eb372e55c283dc9c9baf144db5f59aa0f4c

See more details on using hashes here.

File details

Details for the file unsio-1.0.2-cp38-cp38-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for unsio-1.0.2-cp38-cp38-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 fc86a7a57556235191cbf9e8b08e4d5133f071260d0eb8ca706b60cc3992c6b8
MD5 26e6dd642e87922a971ed8e3a8c5158e
BLAKE2b-256 0d0917d7ee7a296de057fda02071c9d2de1c130190c40df01f0e2a6733c49570

See more details on using hashes here.

File details

Details for the file unsio-1.0.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for unsio-1.0.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 69bc2d1d88835cbfa7d089ef0b0cc06667d49a22a7dec846fde6eea91ea22ec7
MD5 56314d396a8d9efb6b8eb9e3be047343
BLAKE2b-256 7e94b946bcc4586a973a984dfa9b84632b443f99bc2a5aea551473dbb6c74235

See more details on using hashes here.

File details

Details for the file unsio-1.0.2-cp38-cp38-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for unsio-1.0.2-cp38-cp38-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 86f6ec4699d58e34e855e352f42340fcf558c6f84d98867b9e992e400340b26a
MD5 97c11c2ce1fdadf1324c7d96d36b7ceb
BLAKE2b-256 ccac6d5d08be68786695f615ffc571130cdbc0cb830c2a8d7c51de1e99f406a3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page