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

Support IrrationalConstants 0.2 #44

Merged
merged 6 commits into from
Jun 30, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name = "Tau"
uuid = "c544e3c2-d3e5-5802-ac44-44683f340e4a"
version = "1.0.0"
version = "1.1.0"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be on the safe side since types change and hence possibly dispatches are broken:

Suggested change
version = "1.1.0"
version = "2.0.0"


[deps]
IrrationalConstants = "92d709cd-6900-40b7-9082-c6be49f344b6"

[compat]
IrrationalConstants = "0.1"
IrrationalConstants = "0.1, 0.2"
julia = "1"

[extras]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ julia> tau === τ ≈ 2*pi
true

julia> typeof(tau)
Irrational{:twoπ}
IrrationalConstants.Twoπ
```

Note: to input the τ character, type `\tau` then press <kbd>Tab</kbd>.
Expand Down
2 changes: 1 addition & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ using Tau
using Test

@testset "self-identity" begin
@test tau isa Irrational{:twoπ}
@test tau isa Tau.IrrationalConstants.Twoπ
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double checking: this works with both IrrationalConstants 0.1 and 0.2?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, no, the test doesn't. Of course, the package/constant works with either version but it's a different type since IrrationalConstants changed the types. I guess a better test might be based on twoπ directly:

Suggested change
@test tau isa Tau.IrrationalConstants.Twoπ
@test tau === Tau.IrrationalConstants.twoπ

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed it, I think it's better now @giordano.

The question made me wonder whether we should be also make a breaking release, as we did in IrrationalConstants, just to be sure that the different type does not break dispatches of some user. It seems less likely though, at least according to Juliahub no packages depend on Tau.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we have the following two possibilities.

  • Do not consider this PR as breaking, and update the compat table with 0.1, 0.2.
  • Consider this PR as breaking, and update the compat table with 0.2.

The current behaviour in this PR

  • Consider this PR as breaking, and update the compat table with 0.1, 0.2.

is inconsistent because users may experience surprising type changes in the following situation.

  • The user depends on Tau.jl v2.0.0.
  • The user depends on SomePkg.jl that depends on IrrationalConstants.jl.
  • SomePkg.jl updates its compat table of IrrationalConstants.jl from 0.1 to 0.1, 0.2 without a breaking change.
  • Then, the type of Tau.tau will be changed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I guess you're right and it's safer to drop support for IrrationalConstants 0.1.

@test τ === τ
@test τ === tau
end
Expand Down