https://github.com/xzackli/referenceimplementations.jl

nested implementation selector

https://github.com/xzackli/referenceimplementations.jl

Science Score: 10.0%

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

  • CITATION.cff file
  • codemeta.json file
  • .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 (8.5%) to scientific vocabulary

Keywords

julia metaprogramming
Last synced: 5 months ago · JSON representation

Repository

nested implementation selector

Basic Info
  • Host: GitHub
  • Owner: xzackli
  • License: mit
  • Language: Julia
  • Default Branch: main
  • Homepage:
  • Size: 229 KB
Statistics
  • Stars: 5
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Topics
julia metaprogramming
Created almost 5 years ago · Last pushed almost 5 years ago
Metadata Files
Readme License

README.md

ReferenceImplementations.jl

Dev Build Status codecov

This package exports the @refimpl macro to help you write fast scientific code. It lets you define two implementations of the same method, by prefacing the reference implementation's definition with @refimpl. The non-reference implementation is called by default, but the reference implementation can be invoked in an expression using the same macro @refimpl, even if the method call is deeply nested.

For more instructions, please consult the documentation.

How?

If the @refimpl macro is applied to a method definition, it injects a first argument of type ReferenceImplementations.RefImpl into the signature. This performs the transform julia func(args...; kwargs...) ⇨ func(::ReferenceImplementations.RefImpl, args...; kwargs...) with the type signatures preserved (so where and ::T match, for example). When you apply the @refimpl macro to an expression that isn't a function definition, it applies a Cassette pass for each top-level function call in an expression, which replaces func(args...; kwargs...) with func(::ReferenceImplementations.RefImpl, args...; kwargs...) if that method exists.

This also means that you can manually call the reference implementation without the macro, using julia using ReferenceImplementations: RefImpl func(RefImpl(), args...; kwargs...)

Owner

  • Name: Zack Li
  • Login: xzackli
  • Kind: user
  • Location: Berkeley, CA

cosmologist at Berkeley / CITA

GitHub Events

Total
Last Year

Committers

Last synced: almost 3 years ago

All Time
  • Total Commits: 48
  • Total Committers: 3
  • Avg Commits per committer: 16.0
  • Development Distribution Score (DDS): 0.229
Top Committers
Name Email Commits
xzackli x****i@g****m 37
Zack Li zq@p****u 10
github-actions[bot] 4****]@u****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 1
  • Total pull requests: 4
  • Average time to close issues: less than a minute
  • Average time to close pull requests: about 12 hours
  • Total issue authors: 1
  • Total pull request authors: 2
  • Average comments per issue: 3.0
  • Average comments per pull request: 0.0
  • Merged pull requests: 3
  • Bot issues: 0
  • Bot pull requests: 2
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
  • JuliaTagBot (1)
Pull Request Authors
  • github-actions[bot] (2)
  • xzackli (2)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • julia 1 total
  • Total dependent packages: 1
  • Total dependent repositories: 0
  • Total versions: 3
juliahub.com: ReferenceImplementations

nested implementation selector

  • Versions: 3
  • Dependent Packages: 1
  • Dependent Repositories: 0
  • Downloads: 1 Total
Rankings
Dependent repos count: 9.9%
Dependent packages count: 23.0%
Average: 32.9%
Stargazers count: 45.1%
Forks count: 53.5%
Last synced: 6 months ago