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

Rework units #59

Merged
merged 35 commits into from Mar 25, 2014

Conversation

Projects
None yet
4 participants
@byorgey
Member

byorgey commented Mar 25, 2014

Move toOutput etc. into -core, using a generic approach. All the units work.

This was done at the expense of delayed leaves, and hence of arrows. (However, the way we were handling delayed leaves before wasn't really working anyway.) So we could merge this back into units but we still need to figure out what we are doing with those.

Sorry for the mess below; it was necessary to merge master into this branch to access the newly-moved-to-core version of avgScale, so most of the commits listed below are actually from that. The last 6 commits or so (beginning with "some experiments-in-progress...") are the important ones to look at.

@jeffreyrosenbluth

This comment has been minimized.

Show comment
Hide comment
@jeffreyrosenbluth

jeffreyrosenbluth Mar 10, 2014

Member

I guess we could be slightly more general and have Floating (Scalar v) instead of Double ?

Member

jeffreyrosenbluth commented on src/Diagrams/Core/Transform.hs in e0b53fb Mar 10, 2014

I guess we could be slightly more general and have Floating (Scalar v) instead of Double ?

This comment has been minimized.

Show comment
Hide comment
@byorgey

byorgey Mar 11, 2014

Member

Yes, that sounds like a nice generalization, and I don't think it will cause any problems for type inference. It matches the general type of determinant.

Member

byorgey replied Mar 11, 2014

Yes, that sounds like a nice generalization, and I don't think it will cause any problems for type inference. It matches the general type of determinant.

@jeffreyrosenbluth

This comment has been minimized.

Show comment
Hide comment
@jeffreyrosenbluth

jeffreyrosenbluth Mar 11, 2014

Member

Is there a way to write a function that just gives the dimension of the vector space it lives in.
something like

dimension :: forall v. HasLinearMap v => Int
dimension  = length (decompose (zeroV :: v))
Member

jeffreyrosenbluth commented on src/Diagrams/Core/Transform.hs in 3cbab1f Mar 11, 2014

Is there a way to write a function that just gives the dimension of the vector space it lives in.
something like

dimension :: forall v. HasLinearMap v => Int
dimension  = length (decompose (zeroV :: v))
@jeffreyrosenbluth

This comment has been minimized.

Show comment
Hide comment
@jeffreyrosenbluth

jeffreyrosenbluth Mar 12, 2014

Member

Oops, forgot to do this. thanks

Member

jeffreyrosenbluth commented on 5053596 Mar 12, 2014

Oops, forgot to do this. thanks

This comment has been minimized.

Show comment
Hide comment
@byorgey

byorgey Mar 12, 2014

Member

No worries. I only noticed it after I had already merged the PR.

Member

byorgey replied Mar 12, 2014

No worries. I only noticed it after I had already merged the PR.

bergey and others added some commits Mar 19, 2014

Merge branch 'master' into units2
Conflicts:
	src/Diagrams/Core.hs
	src/Diagrams/Core/Compile.hs

Conflicts had to do with changes to include Annotations.
some experiments-in-progress for fixing units
* Merge master branch into this one
* Move 'toOutput' into diagrams-core, implemented generically
* Wait to convert to output units until after conversion to RTree.
  I know this means DelayedLeaves will be broken; still thinking about
  how to tackle that.
units progress (builds, untested)
* Add "generic" attributes
* Finish toRTree reimplementation
* Remove Options argument from renderData
units: everything seems to work except Normalized
* switch from syb to Data.Data.Lens
* fix the type of 'convert': `Measure (Scalar v)`, not `Measure v` !
fix Normalized units
The diagram has *already* had the global -> output transformation
applied, so don't multiply by that scaling factor again!

@byorgey byorgey referenced this pull request Mar 25, 2014

Merged

Rework of units #169

jeffreyrosenbluth added a commit that referenced this pull request Mar 25, 2014

@jeffreyrosenbluth jeffreyrosenbluth merged commit 1922a00 into units Mar 25, 2014

1 check passed

default The Travis CI build passed
Details

@jeffreyrosenbluth jeffreyrosenbluth deleted the units2 branch Mar 25, 2014

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