Skip to content

Commit

Permalink
Make minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
junyuan-chen committed Apr 3, 2024
1 parent 8adf6c3 commit a891427
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/src/man/date-and-time-values.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ is sufficient for uncovering the represented date/time values for a given format
Each year always consists of 52 weeks.
Any remaining day at the end of a year is counted as the 52th week within that year.
Conversion for a variable with format `"%tw"` is therefore handled differently.
For `"%ty"`, the recorded numerical values are simply the year numbers
For `"%ty"`, the recorded numerical values are simply the calendar years
without any transformation.
A variable with format `"%ty"` is not converted to Julia `Date` or `DateTime`.

Expand Down
7 changes: 4 additions & 3 deletions docs/src/man/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ out.vint
```

It is possible to specify the format of certain variables.
This is can be important, for example, for variables representing date/time.
This can be important, for example, for variables representing date/time.
In the above example, a default format has been selected:

```@repl getting-started
Expand All @@ -178,7 +178,8 @@ colmetadata(out2, :vdate, "format")
```

Notice that since the format `"%tm"` is for months,
the day within the month has been ignored and becomes 1.
the day within a month has been ignored and becomes 1
for the printed value of `Date` in the above example.

!!! info

Expand All @@ -189,7 +190,7 @@ the day within the month has been ignored and becomes 1.

!!! warning

The write support is experimental and not fully developed.
The write support is experimental and requires further testing.
Caution should be taken when writing the data files.

## More Options
Expand Down
1 change: 1 addition & 0 deletions src/LabeledArrays.jl
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ Base.isless(x::LabeledValue, y::Missing) = isless(x.value, y)
Base.isless(x::Missing, y::LabeledValue) = isless(x, y.value)
Base.isapprox(x::LabeledValue, y; kwargs...) = isapprox(x.value, y; kwargs...)
Base.isapprox(x, y::LabeledValue; kwargs...) = isapprox(x, y.value; kwargs...)
Base.ismissing(x::LabeledValue) = ismissing(x.value)

Base.iszero(x::LabeledValue) = iszero(x.value)
Base.isnan(x::LabeledValue) = isnan(x.value)
Expand Down
4 changes: 2 additions & 2 deletions src/datetime.jl
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ function (NDT::Num2DateTime{DT, Week})(num) where DT
return num
else
y = floor(Int, num/52)
return (Date(year(NDT.epoch)+y, 1, 1) + Day(7*(num - 52*y)))
return Date(year(NDT.epoch)+y, 1, 1) + Day(7*(num - 52*y))
end
end

Expand Down Expand Up @@ -167,7 +167,7 @@ function (DTN::DateTime2Num{Num2DateTime{Date, Month}})(dt)
return dt
else
y = year(dt) - year(DTN.ndt.epoch)
step = 12 / DTN.ndt.delta.value
step = 12 ÷ DTN.ndt.delta.value
return Int32(step * y) + floor(Int32, (month(dt)-1) / DTN.ndt.delta.value)
end
end
Expand Down
1 change: 1 addition & 0 deletions test/LabeledArrays.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
@test v1 < v2
@test isless(v1, v2)
@test isapprox(v1, v3)
@test ismissing(v4)

@test !iszero(v1)
@test iszero(LabeledValue(0, lbls1))
Expand Down

0 comments on commit a891427

Please # to comment.