automap

High-performance autoincremented integer-valued mappings. πŸ—ΊοΈ

https://github.com/brandtbucher/automap

Science Score: 36.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • β—‹
    CITATION.cff file
  • βœ“
    codemeta.json file
    Found codemeta.json file
  • βœ“
    .zenodo.json file
    Found .zenodo.json file
  • β—‹
    DOI references
  • β—‹
    Academic publication links
  • βœ“
    Committers with academic emails
    1 of 3 committers (33.3%) from academic institutions
  • β—‹
    Institutional organization owner
  • β—‹
    JOSS paper metadata
  • β—‹
    Scientific vocabulary similarity
    Low similarity (12.0%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

High-performance autoincremented integer-valued mappings. πŸ—ΊοΈ

Basic Info
  • Host: GitHub
  • Owner: brandtbucher
  • License: other
  • Language: C
  • Default Branch: master
  • Homepage:
  • Size: 93.8 KB
Statistics
  • Stars: 19
  • Watchers: 5
  • Forks: 4
  • Open Issues: 6
  • Releases: 21
Created over 6 years ago · Last pushed over 2 years ago
Metadata Files
Readme Funding License

README.md

automap ======= [![latest version](https://img.shields.io/github/release-pre/brandtbucher/automap.svg?style=for-the-badge&label=latest)![latest release date](https://img.shields.io/github/release-date-pre/brandtbucher/automap.svg?style=for-the-badge&label=released)](https://github.com/brandtbucher/automap/releases)[![build status](https://img.shields.io/github/actions/workflow/status/brandtbucher/automap/ci.yml.svg?style=for-the-badge&branch=master)](https://github.com/brandtbucher/automap/actions)[![issues](https://img.shields.io/github/issues-raw/brandtbucher/automap.svg?label=issues&style=for-the-badge)](https://github.com/brandtbucher/automap/issues)

automap is a Python package containing high-performance autoincremented integer-valued mappings.

To install, just run pip install automap.

Examples

automap objects are sort of like "inverse sequences". They come in two variants:

FrozenAutoMap

```py

from automap import FrozenAutoMap ```

FrozenAutoMap objects are immutable. They can be constructed from any iterable of hashable, unique keys.

```py

a = FrozenAutoMap("AAA") Traceback (most recent call last): File "", line 1, in ValueError: 'A' a = FrozenAutoMap("ABC") a automap.FrozenAutoMap(['A', 'B', 'C']) ```

The values are integers, incrementing according to the order of the original keys:

```py

a["A"] 0 a["C"] 2 a["X"] Traceback (most recent call last): File "", line 1, in KeyError: 'X' ```

The full Mapping interface is provided:

```py

[*a.keys()] ['A', 'B', 'C'] [*a.values()] [0, 1, 2] [*a.items()] [('A', 0), ('B', 1), ('C', 2)] a.get("X", 42) 42 "B" in a True [*a] ['A', 'B', 'C'] ```

They may also be combined with each other using the | operator:

```py

b = FrozenAutoMap(range(5)) c = FrozenAutoMap(range(5, 10)) b | c automap.FrozenAutoMap([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) b |= c # Note that b is reassigned, not mutated! b automap.FrozenAutoMap([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) ```

AutoMap

```py

from automap import AutoMap ```

Unlike FrozenAutoMap objects, AutoMap objects can grow; new keys may be added, but existing ones may not be deleted or changed.

```py

d = AutoMap("ABC") d automap.AutoMap(['A', 'B', 'C']) d |= "DEF" # Here, d is mutated! d automap.AutoMap(['A', 'B', 'C', 'D', 'E', 'F']) ```

They also have add and update methods for adding new keys:

```py

e = AutoMap(["I", "II", "III"]) e.add("IV") e automap.AutoMap(['I', 'II', 'III', 'IV']) e.update(["V", "VI", "VII"]) e automap.AutoMap(['I', 'II', 'III', 'IV', 'V', 'VI', 'VII']) ```

Performance

Tests show string-keyed AutoMap objects being created 70% faster and accessed 5% faster than the equivalent dict construction, on average. They also tend to take up the same amount of memory. You can run invoke performance from this repository to see the comparison on your machine.

More details on the design can be found in automap.c.

Owner

  • Name: Brandt Bucher
  • Login: brandtbucher
  • Kind: user
  • Location: Costa Mesa, California

@python Core Developer

GitHub Events

Total
  • Watch event: 2
Last Year
  • Watch event: 2

Committers

Last synced: over 2 years ago

All Time
  • Total Commits: 153
  • Total Committers: 3
  • Avg Commits per committer: 51.0
  • Development Distribution Score (DDS): 0.039
Past Year
  • Commits: 17
  • Committers: 2
  • Avg Commits per committer: 8.5
  • Development Distribution Score (DDS): 0.294
Top Committers
Name Email Commits
Brandt Bucher b****r@g****m 147
Christopher Ariza a****a@f****m 5
Brandt Bucher b****g@u****u 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 11 months ago

All Time
  • Total issues: 15
  • Total pull requests: 6
  • Average time to close issues: about 1 month
  • Average time to close pull requests: 12 days
  • Total issue authors: 4
  • Total pull request authors: 2
  • Average comments per issue: 3.73
  • Average comments per pull request: 5.17
  • Merged pull requests: 4
  • Bot issues: 0
  • Bot pull requests: 1
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
  • flexatone (12)
  • brandtbucher (1)
  • chaburkland (1)
  • kveretennicov (1)
Pull Request Authors
  • flexatone (5)
  • dependabot[bot] (2)
Top Labels
Issue Labels
enhancement (3) discussion (3) good first issue (2) help wanted (1) bug (1)
Pull Request Labels
dependencies (2)

Packages

  • Total packages: 2
  • Total downloads:
    • pypi 2,446 last-month
  • Total dependent packages: 2
    (may contain duplicates)
  • Total dependent repositories: 5
    (may contain duplicates)
  • Total versions: 24
  • Total maintainers: 1
pypi.org: automap

High-performance autoincremented integer-valued mappings.

  • Versions: 20
  • Dependent Packages: 1
  • Dependent Repositories: 5
  • Downloads: 2,446 Last month
Rankings
Dependent packages count: 4.7%
Dependent repos count: 6.7%
Average: 10.8%
Downloads: 13.0%
Stargazers count: 14.5%
Forks count: 15.3%
Maintainers (1)
Last synced: 11 months ago
conda-forge.org: automap
  • Versions: 4
  • Dependent Packages: 1
  • Dependent Repositories: 0
Rankings
Dependent packages count: 28.8%
Dependent repos count: 34.0%
Average: 40.8%
Forks count: 49.6%
Stargazers count: 50.9%
Last synced: 11 months ago

Dependencies

requirements.txt pypi
  • black ==22.3.0
  • hypothesis ==6.46.7
  • invoke ==1.7.1
  • pytest ==7.1.2
  • tzdata ==2022.1
.github/workflows/ci.yml actions
  • actions/checkout v2 composite
  • actions/download-artifact v2 composite
  • actions/setup-python v2 composite
  • actions/upload-artifact v2 composite
  • pypa/cibuildwheel v2.11.2 composite
  • pypa/gh-action-pypi-publish v1.4.2 composite
setup.py pypi