Skip to content

Commit

Permalink
Add scitype overloading, formerly living at ScientificTypes 2.3.1 (#47)
Browse files Browse the repository at this point in the history
* add scitype overloading, formerly living at ScientificTypes 2.3.1

* add forotten files

* Update src/scitypes.jl

Co-authored-by: mtsch <matijacufar@gmail.com>

Co-authored-by: mtsch <matijacufar@gmail.com>
  • Loading branch information
ablaom and mtsch authored Oct 27, 2021
1 parent 85caa24 commit 3cfa088
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Hungarian = "e91730f6-4275-51fb-a7a0-7064cfbd3b39"
MLJModelInterface = "e80e1ace-859a-464e-9ed9-23947d8ae3ea"
PersistenceDiagramsBase = "b1ad91c1-539c-4ace-90bd-ea06abc420fa"
RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01"
ScientificTypes = "321657f4-b219-11e9-178b-2701a2544e81"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"

Expand All @@ -18,6 +19,7 @@ Hungarian = "0.6"
MLJModelInterface = "^0.3.5, 0.4, 1"
PersistenceDiagramsBase = "^0.1.1"
RecipesBase = "1"
ScientificTypes = "2.3.2"
Tables = "1"
julia = "1"

Expand Down
2 changes: 2 additions & 0 deletions src/PersistenceDiagrams.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ using PersistenceDiagramsBase
using RecipesBase
using Statistics
using Tables
import ScientificTypes

include("matching.jl")

Expand All @@ -52,6 +53,7 @@ include("persistenceimages.jl")

include("plotsrecipes.jl")

include("scitypes.jl")
include("mlj.jl")

end
3 changes: 3 additions & 0 deletions src/scitypes.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const ST = ScientificTypes

ST.scitype(::PersistenceDiagram, ::ST.DefaultConvention; kwargs...) = PersistenceDiagram
3 changes: 3 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ end
@safetestset "persistenceimages" begin
include("persistenceimages.jl")
end
@safetestset "scitypes" begin
include("scitypes.jl")
end
@safetestset "mlj" begin
include("mlj.jl")
end
Expand Down
10 changes: 10 additions & 0 deletions test/scitypes.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using PersistenceDiagrams
using ScientificTypes

diagram = PersistenceDiagram([(1, Inf), (2, 3)], dim=0)
@test scitype(diagram) == PersistenceDiagram

diagrams = [diagram, diagram, diagram]
@test scitype(diagrams) == AbstractVector{PersistenceDiagram}

true

2 comments on commit 3cfa088

@mtsch
Copy link
Owner

@mtsch mtsch commented on 3cfa088 Oct 27, 2021

Choose a reason for hiding this comment

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

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Registration pull request created: JuliaRegistries/General/47579

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.9.4 -m "<description of version>" 3cfa088d85533d96a6e27dda79cdb211f67ce113
git push origin v0.9.4

Please sign in to comment.