-
Notifications
You must be signed in to change notification settings - Fork 15
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
Introduce a Unitful extension #126
base: master
Are you sure you want to change the base?
Conversation
Thanks for providing a draft. I have an alterantive proposal: instead of broadening the API further in this direction, I would handle this with
Implementing (Further alternative proposals are welcome). |
I wrote this draft before I saw #95 , and I quite like the idea of adding/stripping units being just one step in a chain--that would mitigate the need to handle the exponential and logistic transformations separately, like I did here
It might make sense to always require a user-defined scale alongside a unit transform, to handle the issue of inappropriate units. It can certainly reuse the scaling transform machinery though. |
I will tackle this chaining extension once we merge #127. |
If there is a way for me to help with such a refactor, let me know--this will be useful for some of my ongoing work, so I can allocate some time. |
@Ickaser: if you have the time for that, it would be great. I am swamped with other work but I promise to review and engage in discussion if you open a PR. Broadly, there are two things I was planning on doing:
etc. Domain checking (ie compatibility of chained transformations) I would not consider initially at the time of construction, just let it error if it does not work. It would be great if there was a simple surface for lowering into |
Hello,
I was perusing documentation for Turing and DynamicHMC recently, and realized that in quite a lot of my code I have been implementing my own transforms, in the fragile way where things are hard-coded everywhere. I think I could stand to clean up and standardize a lot of that code just by having transforms like in this package.
Rather than attempt to broaden the number types of e.g.
ShiftedExp
to admit Unitful quantities, this PR adds a dimensionalDimShiftedExp
, which takes advantage of the type signatures of Unitful quantities to encode the destination units in the type itself.Some things that this PR makes possible:
Two things this PR doesn't currently try to do:
I'm open to discussion on any of these details--just thought that I would throw together a working draft and see if there would be interest in allowing these kinds of transformations.