Skip to main content

A mini-library to process arrays to .json files and viceversa. Developed to pass arrays between Python and C++ through the use of json DOK files.

Project description

ponte

A mini-library to process arrays to .json files and viceversa. Developed to pass arrays between Python and C++ through the use of json DOK files.

Installation

pip install ponte

Contributors

Contributing

  1. Fork it (https://github.com/your-github-user/tensorscout/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Usage Example

For full application, i.e. passing array structures between Python and C++ code, see bridge

import ponte as bridge
import numpy as np

'CREATE A 1-D VECTOR'
X = np.random.choice([0,1,2,3],10,p=[0.7,0.1,0.1,0.1])
'pack vector to .json file'
bridge.tojson('sample.json',X)

'PROCESS JSON FILE BACK TO VECTOR'
array_form = bridge.jsonload('sample.json')
'print vector'
print('array:\n',array_form)

'''
array to DOK:
{
	"map": [
		[1],
		[4],
		[5],
		[8],
		[9]
	],
	"value": [2, 3, 2, 2, 2],
	"odims": [10]
}

DOK to array:
[0. 2. 0. 0. 3. 2. 0. 0. 2. 2.]
'''

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

ponte-0.0.1.tar.gz (2.8 kB view details)

Uploaded Source

File details

Details for the file ponte-0.0.1.tar.gz.

File metadata

  • Download URL: ponte-0.0.1.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.3

File hashes

Hashes for ponte-0.0.1.tar.gz
Algorithm Hash digest
SHA256 c9e0faa0f93f4c84a0d55c15357237a0a42fff7f5a910b01c6f1bbffdc7e51af
MD5 a1b4f8c44572a8a658d3ed37070ec20a
BLAKE2b-256 dde16064bec2fdeb7123a1a8a8f95483e61b510aabf24009c280c4e36700ea29

See more details on using hashes here.

Supported by

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