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

cleanup and deduce of code and types #29

Merged
merged 19 commits into from
Jun 22, 2022
Merged

cleanup and deduce of code and types #29

merged 19 commits into from
Jun 22, 2022

Conversation

heckj
Copy link
Member

@heckj heckj commented Jun 5, 2022

I think I can collapse a lot of the repeated code in here ... merging:

  • AnyContinuousScale
  • ContinuousScale
  • LinearScale
  • LogScale
  • PowerScale
  • RadialScale

into a single type so that I don't need to require around with type erasure, as well as reducing the amount of replicated code that I created while I worked out what this needs to do and how it can be structured.

Now that I've had more time with it, I think ConvertibleToDouble can "go away" and be replaced with a smart initializer and generic code over either BinaryFloatingPoint && Real or some nearby variation of that theme, and another for the case where I want to handle one of the Integer variants using BinaryInteger

@heckj heckj self-assigned this Jun 5, 2022
@codecov
Copy link

codecov bot commented Jun 5, 2022

Codecov Report

Merging #29 (24d46fe) into main (607301e) will increase coverage by 1.28%.
The diff coverage is 84.23%.

❗ Current head 24d46fe differs from pull request most recent head 22bf3c6. Consider uploading reports for the commit 22bf3c6 to get more accurate results

@@            Coverage Diff             @@
##             main      #29      +/-   ##
==========================================
+ Coverage   87.59%   88.87%   +1.28%     
==========================================
  Files          29       24       -5     
  Lines        3079     1978    -1101     
==========================================
- Hits         2697     1758     -939     
+ Misses        382      220     -162     
Impacted Files Coverage Δ
Sources/SwiftVizScale/NiceValue.swift 93.98% <ø> (+0.35%) ⬆️
...ources/SwiftVizScale/ContinuousScaleProtocol.swift 58.92% <58.92%> (ø)
Sources/SwiftVizScale/ContinuousScaleType.swift 84.61% <84.61%> (ø)
Sources/SwiftVizScale/ContinuousScale.swift 87.93% <87.82%> (+34.98%) ⬆️
...ests/SwiftVizScaleTests/ContinuousScaleTests.swift 91.02% <100.00%> (ø)
...ests/SwiftVizScaleTests/ExternalPackageTests.swift 100.00% <100.00%> (ø)
Tests/SwiftVizScaleTests/LogScaleTests.swift 85.56% <100.00%> (-3.10%) ⬇️
Tests/SwiftVizScaleTests/NiceValueTests.swift 100.00% <100.00%> (+2.71%) ⬆️
Tests/SwiftVizScaleTests/PowerScaleTests.swift 81.53% <100.00%> (-9.44%) ⬇️
Tests/SwiftVizScaleTests/ScaleFactoryTests.swift 80.00% <100.00%> (-5.72%) ⬇️
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 607301e...22bf3c6. Read the comment docs.

@heckj heckj merged commit 348d04f into main Jun 22, 2022
@heckj heckj deleted the collapsing-types branch June 22, 2022 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant