Skip to content

Commit

Permalink
fix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
eohne committed Oct 6, 2024
1 parent 070fcaf commit dbe03e4
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 25 deletions.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ The package is registered in the [`General`](https://github.com/JuliaRegistries/
## Precompilation

### Version 0.1.8
Precompilation of the `get_prices` function. This has caused precompilation hangs for Julia 1.10 and 1.11 - package typically still precompiles but takes long and gives warnings. One user at least has reported errors. Note precompilation also does not work if you require to set a proxy to access the internet.
Precompilation of the `get_prices` function. This has caused precompilation hangs for Julia 1.10 and 1.11 - package typically still precompiles but takes long and gives warnings. Note precompilation also does not work if you require to set a proxy to access the internet.

To Install this version enter the package mode by entering `]` in the REPL and run the following command:
```julia
Expand All @@ -44,6 +44,13 @@ To Install this version enter the package mode by entering `]` in the REPL and r
### Version 0.1.9
Does not precompile.
To Install this version enter the package mode by entering `]` in the REPL and run the following command:
```julia
(@v1.10) pkg> add YFinance @v0.1.9
```

### Version 0.1.10
Precompiles only the response processing part of the `get_prices` and not the HTTP request. Most of the compilation time lies unfortunately with the request itself.
To Install this version enter the package mode by entering `]` in the REPL and run the following command:
```julia
(@v1.10) pkg> add YFinance
```
Expand Down
4 changes: 2 additions & 2 deletions docs/src/Prices.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ If you want to return a TimeArray from TimeSeries.jl execute `get_prices(TimeArr
You can also covert from the OrderedDict to these by using the following function:

```@docs
sink_prices_to(::Type{TimeArray},::OrderedDict{String,Any})
sink_prices_to(::Type{TSFrame},::OrderedDict{String,Any})
sink_prices_to(::Type{TimeArray}, x::OrderedDict{String, Union{String,Vector{DateTime},Vector{Float64}}})
sink_prices_to(::Type{TSFrame}, x::OrderedDict{String, Union{String,Vector{DateTime},Vector{Float64}}})
```
## get_prices

Expand Down
1 change: 1 addition & 0 deletions docs/src/VersionChanges.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- specified intervals are now observed
* Significant code refactoring for improved maintainability and readability of the `get_prices` function
* An `OrderedDict{String, Union{String,Vector{DateTime},Vector{Float64}}}` is now returned by get_prices rather than `OrderedDict{String,Any}`
* Added precompilation for the response processing part of the `get_prices` function only


!!! info "v0.1.9"
Expand Down
19 changes: 13 additions & 6 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,26 @@ To load the package simply type the following:
using YFinance
```

## Precompilation

### Version 0.1.8
Precompilation of the `get_prices` function. This has caused precompilation hangs for Julia 1.10 and 1.11 - package typically still precompiles but takes long and gives warnings. One user at least has reported errors. Note precompilation also does not work if you require to set a proxy to access the internet.
## Precompilation across different versions

### Version 0.1.10
Precompiles only the response processing part of the `get_prices` function and not the HTTP request. Most of the compilation time lies unfortunately with the request itself.
To Install this version enter the package mode by entering `]` in the REPL and run the following command:
```julia
(@v1.10) pkg> add YFinance @v0.1.8
(@v1.10) pkg> add YFinance
```

### Version 0.1.9
Does not precompile.
To Install this version enter the package mode by entering `]` in the REPL and run the following command:
```julia
(@v1.10) pkg> add YFinance
(@v1.10) pkg> add YFinance @v0.1.9
```

### Version 0.1.8
Precompilation of the `get_prices` function. This has caused precompilation hangs for Julia 1.10 and 1.11 - package typically still precompiles but takes long and gives warnings. One user at least has reported errors. Note precompilation also does not work if you require to set a proxy to access the internet.

To Install this version enter the package mode by entering `]` in the REPL and run the following command:
```julia
(@v1.10) pkg> add YFinance @v0.1.8
```
16 changes: 0 additions & 16 deletions src/Prices.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,6 @@ _date_to_unix(dt::Date) = Int(floor(datetime2unix(DateTime(dt))))
_date_to_unix(dt::DateTime) = Int(floor(datetime2unix(dt)))
_date_to_unix(dt::AbstractString) = _date_to_unix(Date(dt, dateformat"yyyy-mm-dd"))

function _clean_prices_nothing(x::Any)
output = Vector{Float64}(undef, length(x))
map!(output, x) do val
if isnothing(val)
return NaN
elseif val isa Integer
return Float64(val)
else
return val
end
end

return output
end


function _clean_prices_nothing(x::AbstractVector)
output = Vector{Float64}(undef, length(x))
map!(output, x) do val
Expand Down

0 comments on commit dbe03e4

Please sign in to comment.