Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Wishlist] Define an AbstractQuantity type #186

Open
giordano opened this issue Nov 5, 2018 · 2 comments
Open

[Wishlist] Define an AbstractQuantity type #186

giordano opened this issue Nov 5, 2018 · 2 comments

Comments

@giordano
Copy link
Collaborator

giordano commented Nov 5, 2018

A few months ago I've created a new package to provide physical constants: https://github.com/JuliaPhysics/PhysicalConstants.jl This package uses Unitful.jl and defines a new type which is mostly based on my proposal at #81. In order to be able to automatically use a Constant object in mathematical operations, I think it would be great to have an AbstractQuantity type here, that can be subclassed by PhysicalConstants.jl (see JuliaPhysics/PhysicalConstants.jl#2). Quantity would be another concrete subtype of AbstractQuantity. I don't think the change would be very disruptive, it'd only be necessary to define the interface of AbstractQuantity and use it throughout this package (rather than accessing named fields).

@ajkeller34
Copy link
Collaborator

Should this issue stay open given that #204 was merged, and if so what remains to be done for your needs?

@giordano
Copy link
Collaborator Author

It'd be good to have a getter function for the val field just as a nicer interface than a.val. This function would be semantically different from ustrip, and probably won't be exported, I don't expect users to need it.

Apart from this, I think this ticket can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants