NumericalTypeAliases
A collection of type aliases restricting to numerical for multiple dispatch.
Science Score: 67.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
Found codemeta.json file -
✓.zenodo.json file
Found .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 (12.7%) to scientific vocabulary
Repository
A collection of type aliases restricting to numerical for multiple dispatch.
Basic Info
- Host: GitHub
- Owner: AP6YC
- License: mit
- Language: Julia
- Default Branch: develop
- Size: 990 KB
Statistics
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 6
Metadata Files
README.md
A collection of simple type aliases restricting to numerical vectors or matrices for multiple dispatch.
Please read the documentation for detailed usage and tutorials.
| Stable Docs | Dev Docs | Testing Status | Coverage |
|:----------------:|:------------:|:----------------:|:------------:|
| |
|
|
|
| Release | JuliaHub Status | Dependents | Zenodo DOI |
|
|
|
|
|
Overview
The purpose of this package is to define a set of commonly used aliases in numerical algorithms when it is known that an input vector or matrix should have an element type of floating-point or integer.
This package was inspired by the blurb in StatsBase.jl that defined a set of type aliases to serve this very purpose.
Installation
This project is distributed as a Julia package, available on JuliaHub. Its usage follows the usual Julia package installation procedure, interactively:
julia
] add NumericalTypeAliases
or programmatically:
julia
using Pkg
Pkg.add("NumericalTypeAliases")
You may also add the package directly from GitHub to get the latest changes between releases:
julia
] add https://github.com/AP6YC/NumericalTypeAliases.jl
Quickstart
After installation, load the module with
julia
using NumericalTypeAliases
Then, you can define your functions with these type aliases. For example, say that you have a function that accepts only real-valued vectors because integer don't make sense in your specific situation:
julia
function my_real_func(input::RealVector)
# Do some math on a 1D vector with floats.
end
Or say that you know that you need a function to operate on an array with a list of indices.
You know that floats don't make sense for indexing, so you would write with IntegerVector:
julia
function my_indexer(data::RealMatrix, indices::IntegerVector)
for ix in eachindex(indices)
println(data[ix, :])
end
end
Furthermore, if you know that you need a real-valued number but want your package to still support 32-bit systems, you wouldn't hardcode Float64 everywhere like usual.
Instead, you could write with the abstract type RealFP (which is just an alias for AbstractFloat):
julia
function my_float_func(datum::RealFP)
# Do math with a real-valued floating point variable
end
As a bonus, say that you want to specify a hardcoded type within a struct as a float, but you don't want to write Float64 or Float32.
In the same way that the Julia Base defines an Int as the largest integer on your system, you can define a variable to be of the larget native floating point variable on your system depending on the system word size with Float:
```julia
Make a struct that will compile with the largest available float size
struct MyStruct cool_variable::Float end
Make a cool struct
MyStruct(3.14) ```
NOTE RealFP is the abstract type, and Float is the concrete type.
This is just like in base Julia where Integer is the abstract type, and Int is the concrete type.
This Float type is provided for semantic convenience, though beware that it has been the subject of great debate.
Aliases
The aliases exported in this package are:
- Real-valued arrays:
RealArray: an arbitrary size array of floats.RealVector: a 1-D vector of floats.RealMatrix: a 2-D matrix of floats.
- Integer-valued arrays:
IntegerArray: an arbitrary size array of integers.IntegerVector: a 1-D vector of integers.IntegerMatrix: a 2-D matrix of integers.
- Single values:
Furthermore, the package exports some convenience variables:
NTA_VERSION: the version ofNumericalTypeAliases.jlthat is installed on the system.NTA_ABSTRACT_TYPES: a list of the abstract types in the package.NTA_CONCRETE_TYPES: a list of the concrete types in the package.NTA_TYPES: a combined list of all abstract and concrete types in the package.
Contributing
If you have a question or concern, please raise an issue. For more details on how to work with the project, propose changes, or even contribute code, please see the Developer Notes in the project's documentation.
In summary:
- Questions and requested changes should all be made in the issues page. These are preferred because they are publicly viewable and could assist or educate others with similar issues or questions.
- For changes, this project accepts pull requests (PRs) from
feature/<my-feature>branches onto thedevelopbranch using the GitFlow methodology. If unit tests pass and the changes are beneficial, these PRs are merged intodevelopand eventually folded into versioned releases. - The project follows the Semantic Versioning convention of
major.minor.patchincremental versioning numbers. Patch versions are for bug fixes, minor versions are for backward-compatible changes, and major versions are for new and incompatible usage changes.
FAQs
You may have some questions....
Why does this package exist?
I have been duplicating this code across several different Julia projects, so I decided to finally modularize it like a big kid.
Why not use
ScientificTypes.jl?
This package may very well evolve to convert its type aliases into an extended ScientificTypes convention.
But today is not that day.
Why is the testing coverage at 0%?
The Julia unit testing coverage methods don't seem to concern themselves with constant aliases of types, which is the only thing that this package contains. Despite the fact that these types are tested with various assertions, these sadly don't register as covered lines. Full coverage reporting is planned for this package in the future, but today is not that day.
Why the over-the-top retro logo?
This package is so small, simple, and downright boring that it had might as well have a flashy logo to be any kind of memorable whatsoever. Also, retro is always in style (contradiction intended).
Acknowledgements
Authors
This package is developed and maintained by Sasha Petrenko with sponsorship by the Applied Computational Intelligence Laboratory (ACIL). This project is supported by grants from the Night Vision Electronic Sensors Directorate, the DARPA Lifelong Learning Machines (L2M) program, Teledyne Technologies, and the National Science Foundation. The material, findings, and conclusions here do not necessarily reflect the views of these entities.
History
- 9/29/2022 - Begin project.
- 9/30/2022 - Submit v0.1.0 to JuliaHub.
- 10/10/2022 - v0.2.0 release.
License
This software is openly maintained by the ACIL of the Missouri University of Science and Technology under the MIT License.
Citation
This project has a citation file file that generates citation information for the package, which can be accessed at the "Cite this repository button" under the "About" section of the GitHub page.
You may also cite this repository with the following BibTeX entry:
bibtex
@misc{NumericalTypeAliases,
doi = {10.5281/zenodo.7183296},
url = {https://doi.org/10.5281/zenodo.7183296},
author = {Sasha Petrenko},
title = {NumericalTypeAliases.jl: A Julia Package for Function Dispatch on Numerical Types},
}
Owner
- Name: Sasha Petrenko
- Login: AP6YC
- Kind: user
- Website: https://ap6yc.github.io/
- Repositories: 48
- Profile: https://github.com/AP6YC
Graduate researcher of applied computational intelligence at the Missouri University of Science and Technology.
Citation (CITATION.cff)
# CFF version for the document
cff-version: 1.2.0
# Authors list
authors:
- family-names: "Petrenko"
given-names: "Sasha"
orcid: "https://orcid.org/0000-0003-2442-8901"
website: "https://ap6yc.github.io/"
email: "sap625@mst.edu"
alias: "AP6YC"
affiliation: "Missouri University of Science and Technology"
# Repository title and descriptors
title: "NumericalTypeAliases.jl: A Julia Package for Function Dispatch on Numerical Types"
abstract: "This software is a Julia package for function dispatch on numerical types."
keywords:
- "Julia"
- "Aliases"
- "Numerical Types"
- "Numerical Type Aliases"
identifiers:
- description: "The DOI of the latest NumericalTypeAliases.jl Zenodo archive."
type: "doi"
value: "10.5281/zenodo.7183296"
url: "https://doi.org/10.5281/zenodo.7183296"
repository-code: "https://github.com/AP6YC/NumericalTypeAliases.jl"
license: "MIT"
institution:
name: "Missouri University of Science and Technology"
message: "Please cite this software using the metadata from this citation file."
GitHub Events
Total
Last Year
Issues and Pull Requests
Last synced: 7 months ago
All Time
- Total issues: 14
- Total pull requests: 20
- Average time to close issues: 15 days
- Average time to close pull requests: about 1 hour
- Total issue authors: 2
- Total pull request authors: 1
- Average comments per issue: 0.86
- Average comments per pull request: 0.1
- Merged pull requests: 20
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 1
- Pull requests: 2
- Average time to close issues: about 1 hour
- Average time to close pull requests: 26 minutes
- Issue authors: 1
- Pull request authors: 1
- Average comments per issue: 0.0
- Average comments per pull request: 0.0
- Merged pull requests: 2
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- AP6YC (14)
- JuliaTagBot (1)
Pull Request Authors
- AP6YC (20)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- julia 151 total
- Total dependent packages: 4
- Total dependent repositories: 0
- Total versions: 6
juliahub.com: NumericalTypeAliases
A collection of type aliases restricting to numerical for multiple dispatch.
- Documentation: https://docs.juliahub.com/General/NumericalTypeAliases/stable/
- License: MIT
-
Latest release: 0.2.4
published over 1 year ago
Rankings
Dependencies
- actions/cache v2 composite
- actions/checkout v2 composite
- codecov/codecov-action v1 composite
- julia-actions/julia-buildpkg latest composite
- julia-actions/julia-processcoverage v1 composite
- julia-actions/julia-runtest latest composite
- julia-actions/setup-julia v1 composite
- styfle/cancel-workflow-action 0.6.0 composite
- actions/checkout v2 composite
- julia-actions/setup-julia latest composite
- styfle/cancel-workflow-action 0.9.1 composite
- JuliaRegistries/TagBot v1 composite
