Skip to content

Commit

Permalink
No Precompilation
Browse files Browse the repository at this point in the history
  • Loading branch information
eohne committed Sep 30, 2024
1 parent a78aa7f commit c0c2881
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 16 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
/docs/build
examples.jl
/ToDo
/.vscode
/.vscode
Project with_precompile.toml
src/YFinance with precompile.jl
4 changes: 1 addition & 3 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
name = "YFinance"
uuid = "e4b3b0a2-f9a3-42f3-aabb-32142cceaf77"
authors = ["Elias L Ohneberg"]
version = "0.1.8"
version = "0.1.9"

[deps]
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3"
JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1"
OrderedCollections = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"

[weakdeps]
Expand All @@ -28,7 +27,6 @@ OrderedCollections = "1.3"
TSFrames = "0.2.2"
TimeSeries = "0.24"
julia = "1.6"
PrecompileTools="1"

[extras]
TSFrames = "9f90e835-9451-4aaa-bcb1-743a1b8d2f84"
Expand Down
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,23 @@ The package is registered in the [`General`](https://github.com/JuliaRegistries/
Pkg.add("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.

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
```

### 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
```

# Examples:

There are more examples in the Docs.
Expand Down
5 changes: 5 additions & 0 deletions docs/src/VersionChanges.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
!!! info "v0.1.9"
## Bug Fix
* Getting rid of precompilation. Precompilation hangs and also doesn't work if a proxy is required ([#23](https://github.com/eohne/YFinance.jl/issues/23))


!!! info "v0.1.8"
## Bug Fix
* `get_prices` fixes indexing error when divsplits=true ([#22](https://github.com/eohne/YFinance.jl/issues/22))
Expand Down
17 changes: 17 additions & 0 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,21 @@ Pkg.add("YFinance")
To load the package simply type the following:
```julia
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.

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
```

### 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
```
12 changes: 0 additions & 12 deletions src/YFinance.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ module YFinance
using HTTP
using JSON3
using Random
using PrecompileTools: @setup_workload, @compile_workload

export _PROXY_SETTINGS, create_proxy_settings,clear_proxy_settings, _set_cookies_and_crumb
export validate_symbol,get_valid_symbols,get_prices, get_dividends, get_splits
Expand Down Expand Up @@ -34,15 +33,4 @@ module YFinance
include("ESG.jl");
include("Search_Symbol.jl");
include("News_Search.jl");


@setup_workload begin
@compile_workload begin
get_prices("AAPL",interval = "1m",range="1d");
get_prices("AAPL",interval = "1d",startdt=Date(2009,01,01), enddt = Date(2009,01,05));
get_prices("AAPL",interval = "1d",startdt="2009-01-01", enddt = "2009-01-05");
get_prices("AAPL",interval = "1d",startdt="2009-01-01", enddt = "2009-01-05",prepost=true);
get_prices("AAPL",interval = "1d",startdt="2009-01-01", enddt = "2009-01-05",divsplits=true);
end
end
end

0 comments on commit c0c2881

Please sign in to comment.