-
Notifications
You must be signed in to change notification settings - Fork 69
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
Symbol column indexing #377
Changes from all commits
d847747
02925a4
a2d3a01
d39f56d
b96edec
eac66e2
a222f08
1ab8c56
c119853
4e37406
a8b6675
429a590
f945707
150940d
2454d63
ccc7745
d6c0116
e87b595
29f16d5
36433b9
3d52e24
3c52e7e
02582db
3762267
cb6a247
e44e4d8
1f37a2b
c4f7a9c
6ad637f
3f78ff0
c1e215d
fa3b03c
d7b94ed
66c9df4
d49688e
09e0726
f84dac0
b91accb
cb90daa
7349f27
75dd518
c2c5680
a2495c9
4ceed75
2208842
7081def
132e940
fb1adb8
3796359
c7fbf6b
6f67f84
70f5a2b
e1b29e3
48465b9
47363b8
670ec9b
17fef95
5d1dcc7
9262ce7
1afaadd
1987ea9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
language: julia | ||
|
||
os: | ||
- linux | ||
|
||
julia: | ||
- 0.7 | ||
- 1.0 | ||
|
||
notifications: | ||
email: false | ||
|
||
sudo: false | ||
|
||
after_success: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,10 +4,10 @@ The `TimeArray` time series type is defined here | |
(with inner constructor code removed for readability): | ||
|
||
```julia | ||
struct TimeArray{T,N,D<:TimeType,A<:AbstractArray} <: AbstractTimeSeries | ||
struct TimeArray{T,N,D<:TimeType,A<:AbstractArray{T,N}} <: AbstractTimeSeries{T,N,D} | ||
timestamp::Vector{D} | ||
values::A # some kind of AbstractArray{T,N} | ||
colnames::Vector{String} | ||
colnames::Vector{Symbol} | ||
meta::Any | ||
|
||
# inner constructor code enforcing invariants | ||
|
@@ -37,7 +37,7 @@ be of the same type. | |
|
||
## `colnames` | ||
|
||
The `colnames` field is a vector of type `String` and contains the | ||
The `colnames` field is a vector of `Symbol` and contains the | ||
names of the columns for each column in the `values` field. The length | ||
of this vector must match the column count of the `values` array, or the | ||
constructor will fail. Since `TimeArrays` are indexable on column names, | ||
|
@@ -48,8 +48,18 @@ where `n` enumerates from 1. | |
## `meta` | ||
|
||
The `meta` field defaults to holding `nothing`, which is represented by | ||
type `Void`. This default is designed to allow programmers to ignore | ||
type `Nothing`. This default is designed to allow programmers to ignore | ||
this field. For those who wish to utilize this field, `meta` can hold | ||
common types such as `String` or more elaborate user-defined types. One | ||
might want to assign a name to an object that is immutable versus | ||
relying on variable bindings outside of the object's type fields. | ||
|
||
## Fields getter functions | ||
|
||
There are four field getter functions exported. | ||
They are named as same as the field names. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Field names are effectively an implementation detail, so I don't know that it's worth mentioning that. Good to document these functions though. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the field name is revealed to user already here: So I added that section. |
||
|
||
- `timestamp(ta::TimeArray)` | ||
- `values(ta::TimeArray)` | ||
- `colnames(ta::TimeArray)` | ||
- `meta(ta::TimeArray)` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the
'
here intentional?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
′
(not'
) is used several times in https://github.com/JuliaStats/TimeSeries.jl/blob/master/src/broadcast.jlI was surprised by the use of such a character also which can't be found easily on my AZERTY keyboard
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those render exactly the same for me. Weird.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not naming simply
:NewClose
(or:Close2
)?What are the english name of
′
,'
and `There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See screenshot to see how it's rendering here (France)

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure about the first one, the second is "apostrophe," and the third is "backtick" (assuming that's rendering for me properly).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's
:Close\prime<tab>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well, I personally love the unicode support in Julia.
I always write code (in my research project) like
x = 1; x\prime<tab> = x + 42
or
x\vec<tab> ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I see. I was on Linux before when it rendered like an apostrophe for me, but on macOS they're distinct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ararslan maybe you should open an issue on your Linux distribution bug tracker because that's quite problematic to have 2 differents characters rendered the same.