12,847 questions
1
vote
0
answers
52
views
How to make @info in julia print full array?
The @info collapses the array and also tries to print it as column which makes no sense for logging. How to tell it to print full array?
Without overriding the default printing/show functions globally ...
-2
votes
0
answers
59
views
The system cannot find the file specified. (os error 2) [in Julia]
I got this error for updating Julia to the latest version using Juliaup:
PS C:\Users\Shayan> juliaup update
Checking for new Julia versions
Checking for new version on channel 'nightly' is taking a ...
0
votes
0
answers
35
views
VS Code not displaying with GraphViz
I'm trying to run the below code.
using Catlab
using Catlab.CategoricalAlgebra
using Catlab.Theories
using Catlab.Graphs
using Catlab.Graphics
@present SchGraph(FreeSchema) begin
V::Ob
E::Ob
src::...
2
votes
3
answers
117
views
How to create Vector{Any}?
I want to create an array that would accept any type (it fail):
values = fill((; some=missing), 10)
values[1] = (; some=1)
without writing bloated code like this
values = Vector{NamedTuple{(:some,),...
1
vote
1
answer
83
views
Efficient multicore for loop in Julia
How to implement @parallel_map macro?
results = @parallel_map for i in 1:10
i^2
end
So that it won't use Any like code below (I assume it slow down code)?
results = Vector{Any}(undef, 10) # ...
3
votes
1
answer
35
views
Julia suplot with gr() widths not uniform
Julia 1.11.7 (Also tried in 1.10.1) on Linux.
Plots v1.41.1
using Plots; gr()
titles = hcat(["X "*string(x) for x in collect(15:-1:8)'], ["X "*string(x) for x in collect(0:7)'])
...
0
votes
1
answer
55
views
How to interpolate string literal with "text" prefix?
How to implement text"Hi $(1+2)" # => Hi 3?
If possible I would like to keep following structure:
macro bind_doc()
quote
text(s::AbstractString) = println(s)
macro text_str(...
3
votes
1
answer
114
views
Parametric struct with type of member depending on value type of struct
I'm trying to write a parametric struct where one of the parameters is a Boolean value type, and where the type of a member should depend on the value of this Boolean. The struct should also inherit ...
0
votes
1
answer
45
views
Per-type constants depending on type parameter
I have a value-parametric struct
struct T{p}
...
end
where p::Int is expected. For each concrete type T{p}, I want to maintain a global(!) constant with value f(p) for some function f. The point ...
2
votes
1
answer
91
views
Making an Gif of Plots using Makie
I have a function that generates plots in Makie. I want to compute a bunch of these plots and turn it into a gif.
The data for these plots is usually difficult to compute, so maybe at best I can ...
0
votes
0
answers
108
views
How to make parallel within the parallel?
Right now I am running a model optimization to optimize one set of parameter for several sites (in total 47 sites, i.e. the cost function sum over these 47 results). Site computation is independent ...
1
vote
1
answer
68
views
Run file in REPL by default with run button
By default the run button (triangle) in VS Code runs as new process, not in REPL. This is only available in the drop down next to it. Is it possible to set running in REPL as default?
Note: I am ...
0
votes
0
answers
48
views
What can corrupt memory in Julia -- "probably modified after bring freed?"
I am very new to Julia. I am working on a project written in Julia and I am using the following script:
import Pkg
Pkg.activate(@__DIR__)
project_root = normpath(joinpath(@__DIR__, "..", &...
3
votes
2
answers
100
views
Round everything to 4 decimal places
Is there global setting to round everything that's printed to the terminal in Julia to 4 decimal places?
Any print - float, arrays, matrices, dataframes, structures - if it has float it should be ...
1
vote
1
answer
60
views
Interaction of user-defined parametric type definitions
I do not understand how constructors interact with the type system at all in the following circumstance.
struct Monomial{T<:Number}
coeff::T
exp::Int
end
struct Poly{T<:Number}
exprs:...
2
votes
1
answer
54
views
How to multithread creation of Array Julia
I have some list of parameters and some complicated function that computes something based on these parameters. I then want to compute some list in the following way:
params = [1,2,3]
func(x) = x+1
...
1
vote
1
answer
39
views
Heatmap from CairoMakie for irregular lattice Julia
I want to make a heatmap of values that are compute over a triangular lattice.
The issue is, that this seems to not display correctly.
For example, the following code gives the following output:
using ...
0
votes
0
answers
59
views
Unable to install package in Julia
I am trying to follow a tutorial which requires the Lathe package.
To install the package, I did:
using Pkg
Pkg.add("Lathe")
This returns the error:
Resolving package versions...
ERROR: ...
1
vote
1
answer
53
views
Setting location of Julia logs to NOT be in $JULIA_DEPOT_PATHS/logs
On a multi-user Linux platform, you want to install a Julia environment once while it is being used by many users (possibly at the same time). One can create a central installation of a Julia ...
0
votes
1
answer
149
views
Julia's Pkg.instantiate() fails with ERROR: expected package Arrow to be registered, error due to registry processing failure.:
I am on a standard Windows machine trying to set up a new Julia project, but I'm completely unable to install any packages. Every attempt to run Pkg.instantiate() fails with the exact same error, the ...
0
votes
0
answers
32
views
Julia upgrade performed not upgrading into Jupyter notebook kernel
I upgraded Julia to version 1.10.9 but the Jupyter kernel to which the Julia extension is configured seems not to recognise this upgrade.
How can I ensure that the Julia upgrade is also extended to ...
0
votes
0
answers
22
views
How to use S3.delete_objects from AWS.jl in Julia?
I want to delete multiple objects from S3 with AWS.jl.
Looping over S3.delete_object() works fine, but is not that fast.
using AWS
@service S3
bucket = "my_bucket"
keys = ["tmp/file1&...
0
votes
0
answers
43
views
Profiling window from ProfileView is not displayed
I have tried a tutorial for ProfileView (https://github.com/timholy/ProfileView.jl):
function profile_test(n)
for i = 1:n
A = randn(100,100,20)
m = maximum(A)
Am = ...
0
votes
2
answers
104
views
Match with regex only returning the first result?
Not sure whether this is intended behaviour, but it confuses me: When I do
match(r"\d+", "10, 11, 12") I only get the first match, in this case m.match <- "10".
m....
0
votes
0
answers
125
views
Issue with JuliaCall function julia_setup
I'm getting an error when running the julia set up command
jl_home<-"C:/Users/[INSERT_USER_HERE]/AppData/Local/Programs/Julia-1.11.4/bin"
julia_setup(jl_home)
returns:
Julia version 1.11....