Skip to content

Commit 76fdf12

Browse files
committed
Rename package to DataScienceTraits.jl
1 parent f7ec535 commit 76fdf12

11 files changed

+204
-202
lines changed

Project.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name = "SciTypes"
1+
name = "DataScienceTraits"
22
uuid = "6cb2f572-2d2b-4ba6-bdb3-e710fa044d6c"
33
authors = ["Elias Carvalho <[email protected]> and contributors"]
44
version = "0.1.0"
@@ -10,10 +10,10 @@ DynamicQuantities = "06fc5a27-2a28-4c7c-a15d-362465fb6821"
1010
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"
1111

1212
[extensions]
13-
SciTypesCategoricalArraysExt = "CategoricalArrays"
14-
SciTypesCoDaExt = "CoDa"
15-
SciTypesDynamicQuantitiesExt = "DynamicQuantities"
16-
SciTypesUnitfulExt = "Unitful"
13+
DataScienceTraitsCategoricalArraysExt = "CategoricalArrays"
14+
DataScienceTraitsCoDaExt = "CoDa"
15+
DataScienceTraitsDynamicQuantitiesExt = "DynamicQuantities"
16+
DataScienceTraitsUnitfulExt = "Unitful"
1717

1818
[compat]
1919
CategoricalArrays = "0.10"

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# SciTypes.jl
1+
# DataScienceTraits.jl
22

3-
[![Build Status](https://github.com/JuliaML/SciTypes.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/JuliaML/SciTypes.jl/actions/workflows/CI.yml?query=branch%3Amain)
4-
[![Coverage](https://codecov.io/gh/JuliaML/SciTypes.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/JuliaML/SciTypes.jl)
3+
[![Build Status](https://github.com/JuliaML/DataScienceTraits.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/JuliaML/DataScienceTraits.jl/actions/workflows/CI.yml?query=branch%3Amain)
4+
[![Coverage](https://codecov.io/gh/JuliaML/DataScienceTraits.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/JuliaML/DataScienceTraits.jl)
55

66
This package provides an alternative implementation to
77
[ScientificTypes.jl](https://github.com/JuliaAI/ScientificTypes.jl)
@@ -15,10 +15,10 @@ that need to dispatch different algorithms depending on scientific
1515
types:
1616

1717
```julia
18-
import SciTypes
18+
import DataScienceTraits as DST
1919

20-
reduction(::SciTypes.Continuous) = sum
21-
reduction(::SciTypes.Categorical) = first
20+
reduction(::DST.Continuous) = sum
21+
reduction(::DST.Categorical) = first
2222
```
2323

2424
Extensions are provided for third-party types such as CoDa.jl
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# -----------------------------------------------------------------
2+
# Licensed under the MIT License. See LICENSE in the project root.
3+
# -----------------------------------------------------------------
4+
5+
module DataScienceTraitsCategoricalArraysExt
6+
7+
using DataScienceTraits
8+
using CategoricalArrays
9+
10+
DataScienceTraits.scitype(::Type{<:CategoricalValue}) = DataScienceTraits.Categorical
11+
DataScienceTraits.elscitype(::Type{<:CategoricalArray}) = DataScienceTraits.Categorical
12+
13+
DataScienceTraits.isordered(array::CategoricalArray) = isordered(array)
14+
15+
end

ext/SciTypesCoDaExt.jl renamed to ext/DataScienceTraitsCoDaExt.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
# Licensed under the MIT License. See LICENSE in the project root.
33
# -----------------------------------------------------------------
44

5-
module SciTypesCoDaExt
5+
module DataScienceTraitsCoDaExt
66

7-
using SciTypes
7+
using DataScienceTraits
88
using CoDa
99

10-
SciTypes.scitype(::Type{<:Composition}) = SciTypes.Compositional
10+
DataScienceTraits.scitype(::Type{<:Composition}) = DataScienceTraits.Compositional
1111

1212
end
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# -----------------------------------------------------------------
2+
# Licensed under the MIT License. See LICENSE in the project root.
3+
# -----------------------------------------------------------------
4+
5+
module DataScienceTraitsDynamicQuantitiesExt
6+
7+
using DataScienceTraits
8+
using DynamicQuantities: AbstractQuantity, Quantity
9+
10+
DataScienceTraits.scitype(::Type{<:AbstractQuantity{T}}) where {T} = scitype(T)
11+
DataScienceTraits.sciconvert(::Type{DataScienceTraits.Continuous}, x::AbstractQuantity{<:Integer}) = float(x)
12+
DataScienceTraits.sciconvert(::Type{DataScienceTraits.Categorical}, x::AbstractQuantity{<:Number}) = convert(Quantity{Int}, x)
13+
DataScienceTraits.sciconvert(::Type{DataScienceTraits.Categorical}, x::AbstractQuantity{<:Integer}) = x
14+
15+
end

ext/DataScienceTraitsUnitfulExt.jl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# -----------------------------------------------------------------
2+
# Licensed under the MIT License. See LICENSE in the project root.
3+
# -----------------------------------------------------------------
4+
5+
module DataScienceTraitsUnitfulExt
6+
7+
using DataScienceTraits
8+
using Unitful: AbstractQuantity, Quantity
9+
10+
DataScienceTraits.scitype(::Type{<:AbstractQuantity{T}}) where {T} = scitype(T)
11+
DataScienceTraits.sciconvert(::Type{DataScienceTraits.Continuous}, x::AbstractQuantity{<:Integer}) = float(x)
12+
DataScienceTraits.sciconvert(::Type{DataScienceTraits.Categorical}, x::AbstractQuantity{<:Number}) = convert(Quantity{Int}, x)
13+
DataScienceTraits.sciconvert(::Type{DataScienceTraits.Categorical}, x::AbstractQuantity{<:Integer}) = x
14+
15+
end

ext/SciTypesCategoricalArraysExt.jl

Lines changed: 0 additions & 15 deletions
This file was deleted.

ext/SciTypesDynamicQuantitiesExt.jl

Lines changed: 0 additions & 15 deletions
This file was deleted.

ext/SciTypesUnitfulExt.jl

Lines changed: 0 additions & 15 deletions
This file was deleted.

src/SciTypes.jl renamed to src/DataScienceTraits.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Licensed under the MIT License. See LICENSE in the project root.
33
# -----------------------------------------------------------------
44

5-
module SciTypes
5+
module DataScienceTraits
66

77
"""
88
SciType

0 commit comments

Comments
 (0)