https://github.com/agoose77/awkward-1.0
Manipulate JSON-like data with NumPy-like idioms.
Science Score: 41.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
○codemeta.json file
-
○.zenodo.json file
-
✓DOI references
Found 3 DOI reference(s) in README -
✓Academic publication links
Links to: zenodo.org -
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (11.1%) to scientific vocabulary
Repository
Manipulate JSON-like data with NumPy-like idioms.
Basic Info
- Host: GitHub
- Owner: agoose77
- License: bsd-3-clause
- Language: Python
- Default Branch: main
- Homepage: https://awkward-array.org
- Size: 17.2 MB
Statistics
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 3
- Releases: 0
Metadata Files
README-pypi.md
Awkward Array is a library for nested, variable-sized data, including arbitrary-length lists, records, mixed types, and missing data, using NumPy-like idioms.
Arrays are dynamically typed, but operations on them are compiled and fast. Their behavior coincides with NumPy when array dimensions are regular and generalizes when they're not.
Motivating example
Given an array of objects with x, y fields and variable-length nested lists like
python
array = ak.Array([
[{"x": 1.1, "y": [1]}, {"x": 2.2, "y": [1, 2]}, {"x": 3.3, "y": [1, 2, 3]}],
[],
[{"x": 4.4, "y": {1, 2, 3, 4]}, {"x": 5.5, "y": [1, 2, 3, 4, 5]}]
])
the following slices out the y values, drops the first element from each inner list, and runs NumPy's np.square function on everything that is left:
python
output = np.square(array["y", ..., 1:])
The result is
python
[
[[], [4], [4, 9]],
[],
[[4, 9, 16], [4, 9, 16, 25]]
]
The equivalent using only Python is
python
output = []
for sublist in array:
tmp1 = []
for record in sublist:
tmp2 = []
for number in record["y"][1:]:
tmp2.append(np.square(number))
tmp1.append(tmp2)
output.append(tmp1)
Not only is the expression using Awkward Arrays more concise, using idioms familiar from NumPy, but it's much faster and uses less memory.
For a similar problem 10 million times larger than the one above (on a single-threaded 2.2 GHz processor),
- the Awkward Array one-liner takes 4.6 seconds to run and uses 2.1 GB of memory,
- the equivalent using Python lists and dicts takes 138 seconds to run and uses 22 GB of memory.
Speed and memory factors in the double digits are common because we're replacing Python's dynamically typed, pointer-chasing virtual machine with type-specialized, precompiled routines on contiguous data. (In other words, for the same reasons as NumPy.) Even higher speedups are possible when Awkward Array is paired with Numba.
Our presentation at SciPy 2020 provides a good introduction, showing how to use these arrays in a real analysis.
Installation
Awkward Array can be installed from PyPI using pip:
bash
pip install awkward
You will likely get a precompiled binary (wheel), depending on your operating system and Python version. If not, pip attempts to compile from source (which requires a C++ compiler, make, and CMake).
Awkward Array is also available using conda, which always installs a binary:
bash
conda install -c conda-forge awkward
If you have already added conda-forge as a channel, the -c conda-forge is unnecessary. Adding the channel is recommended because it ensures that all of your packages use compatible versions:
bash
conda config --add channels conda-forge
conda update --all
Getting help
|
|
- Report bugs, request features, and ask for additional documentation on GitHub Issues.
- You can vote for issues by adding a "thumbs up" (👍) using the "smile/pick your reaction" menu on the top-right of the issue. See the prioritized list of open issues.
- If you have a "How do I...?" question, start a GitHub Discussion with category "Q&A".
- Alternatively, ask about it on StackOverflow with the [awkward-array] tag. Be sure to include tags for any other libraries that you use, such as Pandas or PyTorch.
- To ask questions in real time, try the Gitter Scikit-HEP/awkward-array chat room.
Owner
- Name: Angus Hollands
- Login: agoose77
- Kind: user
- Location: United Kingdom
- Company: 2i2c
- Twitter: agoose77
- Repositories: 230
- Profile: https://github.com/agoose77
Open Source Infrastructure Engineer @ 2i2c. Executable Books core team member. PhD in Nuclear Physics from the University of Birmingham.
Citation (CITATION.cff)
cff-version: 1.2.0 title: "Awkward Array" message: "If you use this software, please cite it as below." doi: "10.5281/zenodo.4341376" date-released: "2018-10-12" authors: - family-names: "Pivarski" given-names: "Jim" affiliation: "Princeton University" orcid: "https://orcid.org/0000-0002-6649-343X" email: "pivarski@princeton.edu" - family-names: "Osborne" given-names: "Ianna" affiliation: "Princeton University" orcid: "https://orcid.org/0000-0002-6955-1033" email: "iosborne@princeton.edu" - family-names: "Ifrim" given-names: "Ioana" affiliation: "Princeton University" orcid: "https://orcid.org/0000-0002-6932-1385" email: "ii3193@princeton.edu" - family-names: "Schreiner" given-names: "Henry" affiliation: "Princeton University" orcid: "https://orcid.org/0000-0002-7833-783X" email: "henryfs@princeton.edu" - family-names: "Hollands" given-names: "Angus" affiliation: "University of Birmingham" orcid: "https://orcid.org/0000-0003-0788-3814" email: "goosey15@gmail.com" - family-names: "Biswas" given-names: "Anish" affiliation: "Manipal Institute Of Technology" orcid: "https://orcid.org/0000-0001-6149-9739" email: "anishbiswas271@gmail.com" - family-names: "Das" given-names: "Pratyush" affiliation: "Purdue University" orcid: "https://orcid.org/0000-0001-8140-0097" email: "reikdas@gmail.com" - family-names: "Roy Choudhury" given-names: "Santam" affiliation: "National Institute of Technology, Durgapur" orcid: "https://orcid.org/0000-0003-0153-9748" email: "santamdev404@gmail.com" - family-names: "Smith" given-names: "Nicholas" affiliation: "Fermilab" orcid: "https://orcid.org/0000-0002-0324-3054" email: "nick.smith@cern.ch"
GitHub Events
Total
Last Year
Issues and Pull Requests
Last synced: 10 months ago
All Time
- Total issues: 0
- Total pull requests: 15
- Average time to close issues: N/A
- Average time to close pull requests: 26 days
- Total issue authors: 0
- Total pull request authors: 1
- Average comments per issue: 0
- Average comments per pull request: 0.8
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 15
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
- dependabot[bot] (15)
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- actions/checkout v3 composite
- actions/upload-artifact v3 composite
- pypa/cibuildwheel v2.8.0 composite
- actions/checkout v3 composite
- actions/download-artifact v3 composite
- actions/upload-artifact v3 composite
- docker/setup-qemu-action v2.0.0 composite
- pypa/cibuildwheel v2.8.0 composite
- pypa/gh-action-pypi-publish v1.5.0 composite
- PyYAML *
- black *
- lark-parser *
- pycparser *
- sphinx >=2.4.4
- sphinx-rtd-theme >=0.5,<1.0
- autograd *
- h5py *
- jax >=0.2.7
- jaxlib >=0.1.57
- jupyter-book *
- matplotlib *
- numba >=0.50.0
- numexpr *
- numpy >=1.13.1
- pandas >=0.24.0
- pyarrow >=2.0.0
- setuptools *
- uproot *
- uproot3 *
- PyYAML * development
- autograd * development
- flake8 * development
- fsspec * development
- jax >=0.2.7 development
- jaxlib >=0.1.57, development
- numba >=0.50.0 development
- numexpr * development
- pandas >=0.24.0 development
- pyarrow >=7.0.0 development
- pytest >=6 test
- pytest-cov * test
- numpy >=1.13.1
- setuptools *
