# Latest

**URL:** https://discourse.julialang.org/latest.md?page=359

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

**Page:** 360

---

## [Clarification on the scope of import/using/include](https://discourse.julialang.org/t/clarification-on-the-scope-of-import-using-include/117222)

<div class="topic-metadata">

**Author:** [@Zotnam](https://discourse.julialang.org/u/Zotnam)\
**Replies:** 1\
**Last updated:** [July 19, 2024, 9:44am UTC](https://discourse.julialang.org/t/clarification-on-the-scope-of-import-using-include/117222 "2024-07-19T09:44:49Z")

</div>

Hi guys, i was trying to understand the source code of the package (conformalprediction.jl, and i have noticed something that i didn’t expect. i am quite new to julia and I thought that when i used import or using …

---

## [Why do functions like similar and copy make 2 allocations for large arrays?](https://discourse.julialang.org/t/why-do-functions-like-similar-and-copy-make-2-allocations-for-large-arrays/117217)

<div class="topic-metadata">

**Author:** [@mike1](https://discourse.julialang.org/u/mike1)\
**Replies:** 7\
**Last updated:** [July 19, 2024, 9:17am UTC](https://discourse.julialang.org/t/why-do-functions-like-similar-and-copy-make-2-allocations-for-large-arrays/117217 "2024-07-19T09:17:02Z")

</div>

Hi, Julia Community! I am trying to wrap my head around this one: Functions like similar and copy seem to make 2 allocations if the array is sufficiently large. Can you help me understand why? julia\> using BenchmarkToo…

---

## [Solving EnsembleProblem efficiently for large systems: memory issues](https://discourse.julialang.org/t/solving-ensembleproblem-efficiently-for-large-systems-memory-issues/116146)

<div class="topic-metadata">

**Author:** [@johannesnauta](https://discourse.julialang.org/u/johannesnauta)\
**Replies:** 10\
**Last updated:** [July 19, 2024, 9:03am UTC](https://discourse.julialang.org/t/solving-ensembleproblem-efficiently-for-large-systems-memory-issues/116146 "2024-07-19T09:03:45Z")

</div>

I apologize in advance for this length thread, but the problem setting is relatively complicated and this was the smallest MWE that I could think of, while still remaining clear. Problem setting I am encountering some i…

---

## [Problem with numerical data in Arrow.jl](https://discourse.julialang.org/t/problem-with-numerical-data-in-arrow-jl/117218)

<div class="topic-metadata">

**Author:** [@Giobbe](https://discourse.julialang.org/u/Giobbe)\
**Replies:** 1\
**Last updated:** [July 19, 2024, 8:58am UTC](https://discourse.julialang.org/t/problem-with-numerical-data-in-arrow-jl/117218 "2024-07-19T08:58:56Z")

</div>

Hello to everyBody. I am trying to use Arrow.jl to store my DataFrames from a e-commerce DB and I noticed that the import function doesnt convert properly decimal values in the dataframes. I post the comparison with CS…

---

## [Is multiple dispatch the best way to handle multiple possible combinations in a package?](https://discourse.julialang.org/t/is-multiple-dispatch-the-best-way-to-handle-multiple-possible-combinations-in-a-package/117215)

<div class="topic-metadata">

**Author:** [@NikoBiele](https://discourse.julialang.org/u/NikoBiele)\
**Replies:** 2\
**Last updated:** [July 19, 2024, 8:39am UTC](https://discourse.julialang.org/t/is-multiple-dispatch-the-best-way-to-handle-multiple-possible-combinations-in-a-package/117215 "2024-07-19T08:39:01Z")

</div>

Hi Julia people, I’m currently working on a major update for my package ‘RayTraceHeatTransfer.jl’. I want the updated package to contain the following features (many of which are new): 1D/2D/3D geometry (user can defi…

---

## [BoundsError in Zygote RNN gradient](https://discourse.julialang.org/t/boundserror-in-zygote-rnn-gradient/117219)

<div class="topic-metadata">

**Author:** [@FabriSR15](https://discourse.julialang.org/u/FabriSR15)\
**Replies:** 0\
**Last updated:** [July 19, 2024, 8:06am UTC](https://discourse.julialang.org/t/boundserror-in-zygote-rnn-gradient/117219 "2024-07-19T08:06:43Z")

</div>

Hi everyone, I’ve experienced some problems with Zygote regarding the computation of gradients of a loss function obtained via sampling. An RNN generates samples autoregressively and the loss function is then computed u…

---

## [Reuse Compiled Code Between REPLs?](https://discourse.julialang.org/t/reuse-compiled-code-between-repls/117175)

<div class="topic-metadata">

**Author:** [@Gast](https://discourse.julialang.org/u/Gast)\
**Replies:** 10\
**Last updated:** [July 19, 2024, 6:56am UTC](https://discourse.julialang.org/t/reuse-compiled-code-between-repls/117175 "2024-07-19T06:56:31Z")

</div>

Hi all, A newbie question: Can the first-time compilation time be avoided when running the same function in different REPL sessions? Specifically, if I execute a function in the terminal REPL and then want to run the sa…

---

## [Select columns from StructArray](https://discourse.julialang.org/t/select-columns-from-structarray/117214)

<div class="topic-metadata">

**Author:** [@jar1](https://discourse.julialang.org/u/jar1)\
**Replies:** 2\
**Last updated:** [July 19, 2024, 6:46am UTC](https://discourse.julialang.org/t/select-columns-from-structarray/117214 "2024-07-19T06:46:31Z")

</div>

How can I choose columns from a StructArray? julia\> StructArray(a=\[1,2\], b=\[10,20\], c=\[100, 200\])\[(:a,:b)\] ERROR: ArgumentError: invalid index: (:a, :b) of type Tuple{Symbol, Symbol}

---

## [DifferentialEquations.jl Spring Mass Damper with variable force being applied](https://discourse.julialang.org/t/differentialequations-jl-spring-mass-damper-with-variable-force-being-applied/117209)

<div class="topic-metadata">

**Author:** [@bryaan](https://discourse.julialang.org/u/bryaan)\
**Replies:** 1\
**Last updated:** [July 19, 2024, 4:10am UTC](https://discourse.julialang.org/t/differentialequations-jl-spring-mass-damper-with-variable-force-being-applied/117209 "2024-07-19T04:10:31Z")

</div>

I am trying to do a simulation of a spring mass damper system where a variable force is constantly being applied at each integer time step. I want to see the mass’ position in a plot. This code seems to be a start but I…

---

## [Names from Base appear in modules](https://discourse.julialang.org/t/names-from-base-appear-in-modules/117205)

<div class="topic-metadata">

**Author:** [@jar1](https://discourse.julialang.org/u/jar1)\
**Replies:** 4\
**Last updated:** [July 19, 2024, 2:51am UTC](https://discourse.julialang.org/t/names-from-base-appear-in-modules/117205 "2024-07-19T02:51:04Z")

</div>

The standard behavior is that names from Base are accessible as properties of normal modules. julia\> module Foobar end Main.Foobar julia\> Main.Foobar.:\* \* (generic function with 237 methods) Do we like this? It seems …

---

## [Constraint on count of variables \>0 in JuMP?](https://discourse.julialang.org/t/constraint-on-count-of-variables-0-in-jump/117072)

<div class="topic-metadata">

**Author:** [@sdwfrost](https://discourse.julialang.org/u/sdwfrost)\
**Replies:** 3\
**Last updated:** [July 18, 2024, 11:46pm UTC](https://discourse.julialang.org/t/constraint-on-count-of-variables-0-in-jump/117072 "2024-07-18T23:46:06Z")

</div>

I have a model with a control variable as follows: @variable(model, 0 ≤ u\[1:(T+1)\] ≤ u\_max) I want to constrain the number of elements in u greater than 0 to be less than a threshold, u\_nonzero\_max. How can I do this …

---

## [Reading Julia documentation. 1. Reassigning to \`pi\`](https://discourse.julialang.org/t/reading-julia-documentation-1-reassigning-to-pi/117016)

<div class="topic-metadata">

**Author:** [@KZiemian](https://discourse.julialang.org/u/KZiemian)\
**Replies:** 3\
**Last updated:** [July 18, 2024, 9:28pm UTC](https://discourse.julialang.org/t/reading-julia-documentation-1-reassigning-to-pi/117016 "2024-07-18T21:28:16Z")

</div>

I’m just started reading documentation of Julia and as a result I will write here some questions that are bogging me. I choose this category, because I would probably have many very basic questions. In the section on va…

---

## [What are the advantages of using a notebook for development?](https://discourse.julialang.org/t/what-are-the-advantages-of-using-a-notebook-for-development/117043)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 13\
**Last updated:** [July 18, 2024, 8:28pm UTC](https://discourse.julialang.org/t/what-are-the-advantages-of-using-a-notebook-for-development/117043 "2024-07-18T20:28:12Z")

</div>

I wander why so many people seem to prefer using a notebook, i.e. the Jupiter Notebook, to develop Julia code, and I am curious to understand which is the main advantage over using a more classical IDE approach (Atom/VsC…

---

## [Struct docstring](https://discourse.julialang.org/t/struct-docstring/117196)

<div class="topic-metadata">

**Author:** [@co1emi11er](https://discourse.julialang.org/u/co1emi11er)\
**Replies:** 0\
**Last updated:** [July 18, 2024, 6:59pm UTC](https://discourse.julialang.org/t/struct-docstring/117196 "2024-07-18T18:59:17Z")

</div>

Hello, I have the following code (you don’t need to understand it, just know its a struct with a docstring as well as an inner constructor with a docstring): """ struct RectangularColumn \<: Column A rectangualr co…

---

## [Simplest Sign type](https://discourse.julialang.org/t/simplest-sign-type/4254)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 14\
**Last updated:** [July 18, 2024, 5:48pm UTC](https://discourse.julialang.org/t/simplest-sign-type/4254 "2024-07-18T17:48:10Z")

</div>

What would be the simplest/best way to encode sign, as in +1 or -1, as a type? Here’s what I can think of: A type with an Int field which I then set to either +1 or -1 when setting an instance of said type, and then m…

---

## [JuliaCon Competition: Most Cursed, Best Title, and Novel Presentation](https://discourse.julialang.org/t/juliacon-competition-most-cursed-best-title-and-novel-presentation/116854)

<div class="topic-metadata">

**Author:** [@oxinabox](https://discourse.julialang.org/u/oxinabox)\
**Replies:** 8\
**Last updated:** [July 18, 2024, 4:58pm UTC](https://discourse.julialang.org/t/juliacon-competition-most-cursed-best-title-and-novel-presentation/116854 "2024-07-18T16:58:30Z")

</div>

I am gonna run a competition for JuliaCon 2024. Valentine said I could. It’s basically just for fun, not too serious. 3 Categories: Most Cursed: for the presentation that is the most cursed idea. Facilitating the mos…

---

## [Problem on solving periodic solution of ODE using orthogonal polynomial pseudo-arclength method](https://discourse.julialang.org/t/problem-on-solving-periodic-solution-of-ode-using-orthogonal-polynomial-pseudo-arclength-method/117177)

<div class="topic-metadata">

**Author:** [@cc2024](https://discourse.julialang.org/u/cc2024)\
**Replies:** 4\
**Last updated:** [July 18, 2024, 3:33pm UTC](https://discourse.julialang.org/t/problem-on-solving-periodic-solution-of-ode-using-orthogonal-polynomial-pseudo-arclength-method/117177 "2024-07-18T15:33:41Z")

</div>

a simple Duffing equation: dx/dt=xt dxt/dt=F0u-a1x1-a1tx1t-a3x1^3 du/dt=-omegav+u(1-u^2-v^2) dv/dt=omegau+v(1-u^2-v^2) parameters: \[omega;F0;a1t;a3\]=\[2;0.01;1;0.008;0.75\] initial state point: \[x0;xt0;u0;v0\]=\[0;0;1…

---

## [ERROR: LoadError: MethodError: no method matching isnan(::Py)](https://discourse.julialang.org/t/error-loaderror-methoderror-no-method-matching-isnan-py/117063)

<div class="topic-metadata">

**Author:** [@raman\_kumar](https://discourse.julialang.org/u/raman_kumar)\
**Replies:** 11\
**Last updated:** [July 18, 2024, 3:40pm UTC](https://discourse.julialang.org/t/error-loaderror-methoderror-no-method-matching-isnan-py/117063 "2024-07-18T15:40:16Z")

</div>

I am getting error while running a local python library in julia. ERROR: LoadError: MethodError: no method matching isnan(::Py) Closest candidates are: isnan(::BigFloat) @ Base mpfr.jl:982 isnan(::Missing) @ …

---

## [Mentioning of Julia for refactoring Linux kernel code?](https://discourse.julialang.org/t/mentioning-of-julia-for-refactoring-linux-kernel-code/117096)

<div class="topic-metadata">

**Author:** [@Kruxigt](https://discourse.julialang.org/u/Kruxigt)\
**Replies:** 6\
**Last updated:** [July 18, 2024, 2:58pm UTC](https://discourse.julialang.org/t/mentioning-of-julia-for-refactoring-linux-kernel-code/117096 "2024-07-18T14:58:59Z")

</div>

https://youtu.be/4WCTGycBceg?t=303 In the video above it seems that Julia is mentioned as a tool for refactoring code related to the development of the Linux kernel. Does anyone have more info on this?

---

## [CategoricalArrays.jl syntax question: vectorizing string operation](https://discourse.julialang.org/t/categoricalarrays-jl-syntax-question-vectorizing-string-operation/117106)

<div class="topic-metadata">

**Author:** [@croberts](https://discourse.julialang.org/u/croberts)\
**Replies:** 7\
**Last updated:** [July 18, 2024, 2:53pm UTC](https://discourse.julialang.org/t/categoricalarrays-jl-syntax-question-vectorizing-string-operation/117106 "2024-07-18T14:53:17Z")

</div>

I’m assuming that there exists convenient syntax to performantly vectorize string operations on categorical arrays? Suppose we want to subset a categorical array to the values whose labels satisfy some condition. Consid…

---

## [Filtering dataframe for unique rows with respect one of column](https://discourse.julialang.org/t/filtering-dataframe-for-unique-rows-with-respect-one-of-column/117185)

<div class="topic-metadata">

**Author:** [@Sahil\_Khan](https://discourse.julialang.org/u/Sahil_Khan)\
**Replies:** 1\
**Last updated:** [July 18, 2024, 1:50pm UTC](https://discourse.julialang.org/t/filtering-dataframe-for-unique-rows-with-respect-one-of-column/117185 "2024-07-18T13:50:30Z")

</div>

Hello i have following DataFrame : julia\> a = DataFrame(x = \[1, 2, 2, 3, 4\], b = \[3, 4, 5, 6, 7\]) 5×2 DataFrame Row │ x b │ Int64 Int64 ─────┼────────────── 1 │ 1 3 2 │ 2 4 3…

---

## [Difference in behaviour between REPL and debugger](https://discourse.julialang.org/t/difference-in-behaviour-between-repl-and-debugger/117101)

<div class="topic-metadata">

**Author:** [@seb](https://discourse.julialang.org/u/seb)\
**Replies:** 6\
**Last updated:** [July 18, 2024, 12:58pm UTC](https://discourse.julialang.org/t/difference-in-behaviour-between-repl-and-debugger/117101 "2024-07-18T12:58:09Z")

</div>

I am encountering an issue with Julia where code will run correctly in the debugger but throws an error when called from the REPL, which I don’t understand. A simple example of this is the code below: function test() …

---

## [How to use gmpy2 bigints in Julia](https://discourse.julialang.org/t/how-to-use-gmpy2-bigints-in-julia/117171)

<div class="topic-metadata">

**Author:** [@gerryj](https://discourse.julialang.org/u/gerryj)\
**Replies:** 3\
**Last updated:** [July 18, 2024, 11:56am UTC](https://discourse.julialang.org/t/how-to-use-gmpy2-bigints-in-julia/117171 "2024-07-18T11:56:45Z")

</div>

I am using gmpy2 in python for bigints, 2000+ digits. I just import the functions i need and use them directly. Can i do that in Julia? How so?. If the answer is make a python call, has anyone checked the comparative p…

---

## [Using lens in Plots.jl with subplots](https://discourse.julialang.org/t/using-lens-in-plots-jl-with-subplots/117162)

<div class="topic-metadata">

**Author:** [@PeX](https://discourse.julialang.org/u/PeX)\
**Replies:** 1\
**Last updated:** [July 18, 2024, 11:23am UTC](https://discourse.julialang.org/t/using-lens-in-plots-jl-with-subplots/117162 "2024-07-18T11:23:20Z")

</div>

Hi all, I’m trying to add zoomed insets to a figure that contains four panels. I’m not sure how to configure the lens function to be added to a specific subplot in the layout. My plot function looks like this: #Adjust…

---

## [Precompilation Error: GR](https://discourse.julialang.org/t/precompilation-error-gr/110488)

<div class="topic-metadata">

**Author:** [@MisterX](https://discourse.julialang.org/u/MisterX)\
**Replies:** 17\
**Last updated:** [July 18, 2024, 8:33am UTC](https://discourse.julialang.org/t/precompilation-error-gr/110488 "2024-07-18T08:33:08Z")

</div>

Hello, what is the problem? Thank you… ? GR\_jll ? Plots ? Plots → UnitfulExt 139 dependencies successfully precompiled in 94 seconds. 6 already precompiled. 1 dependency had output during precompilation: GR ERROR: Loa…

---

## [Finding \*all\* the eigenvalues of a sparse matrix?](https://discourse.julialang.org/t/finding-all-the-eigenvalues-of-a-sparse-matrix/116895)

<div class="topic-metadata">

**Author:** [@rafaelbailo](https://discourse.julialang.org/u/rafaelbailo)\
**Replies:** 24\
**Last updated:** [July 18, 2024, 9:22am UTC](https://discourse.julialang.org/t/finding-all-the-eigenvalues-of-a-sparse-matrix/116895 "2024-07-18T09:22:44Z")

</div>

Seems that LinearAlgebra.jl does not work with sparse matrices, and the libraries that do (e.g. Arpack.jl, ArnoldiMethod.jl, KrylovKit.jl) all use iterative methods, which are not efficient to find all the eigenvalues. S…

---

## [Decimal2rational](https://discourse.julialang.org/t/decimal2rational/117147)

<div class="topic-metadata">

**Author:** [@mefi](https://discourse.julialang.org/u/mefi)\
**Replies:** 7\
**Last updated:** [July 18, 2024, 8:42am UTC](https://discourse.julialang.org/t/decimal2rational/117147 "2024-07-18T08:42:29Z")

</div>

Is there an easy way to convert a periodic decimal number into a fraction? As a mathematician I like not rationalize(0.85555555555)!! That really leaves a homemade algorithm that handles the periodic part separately? t…

---

## [Reducing Numerical Diffusion in advection model using ModelingToolkit.jl and MethodOfLines.jl](https://discourse.julialang.org/t/reducing-numerical-diffusion-in-advection-model-using-modelingtoolkit-jl-and-methodoflines-jl/117135)

<div class="topic-metadata">

**Author:** [@el\_desesperado](https://discourse.julialang.org/u/el_desesperado)\
**Replies:** 7\
**Last updated:** [July 18, 2024, 8:21am UTC](https://discourse.julialang.org/t/reducing-numerical-diffusion-in-advection-model-using-modelingtoolkit-jl-and-methodoflines-jl/117135 "2024-07-18T08:21:04Z")

</div>

Hello, I have been trying to model the advection equation( du(x,t)/dt + du(x,t)/dx = 0) using ModelingToolkit.jl and MethodOfLines.jl. import OrdinaryDiffEq, ModelingToolkit, MethodOfLines, DomainSets ModelingToolkit.…

---

## [How to estimate many successive parameters of system of ODEs?](https://discourse.julialang.org/t/how-to-estimate-many-successive-parameters-of-system-of-odes/117144)

<div class="topic-metadata">

**Author:** [@LSchueler](https://discourse.julialang.org/u/LSchueler)\
**Replies:** 3\
**Last updated:** [July 18, 2024, 7:40am UTC](https://discourse.julialang.org/t/how-to-estimate-many-successive-parameters-of-system-of-odes/117144 "2024-07-18T07:40:23Z")

</div>

Hi, I have a system of ODEs for which I’d like to estimate its parameters by fitting it to observational data. The only “interesting” part of this problem is that the parameters vary on a daily basis. A naive approach …

---

## [Can only run Unit Tests with Gurobi locally because of Licence](https://discourse.julialang.org/t/can-only-run-unit-tests-with-gurobi-locally-because-of-licence/117169)

<div class="topic-metadata">

**Author:** [@K5Julien](https://discourse.julialang.org/u/K5Julien)\
**Replies:** 1\
**Last updated:** [July 18, 2024, 7:10am UTC](https://discourse.julialang.org/t/can-only-run-unit-tests-with-gurobi-locally-because-of-licence/117169 "2024-07-18T07:10:10Z")

</div>

Dear Julia Discourse Optimization, I can not run Unit Tests (Test.jl) with Gurobi, because CI.yml file and GitHub action don’t have a valid Gurobi Licence. @test rspoptimize(pars, 1, optimizer\_with\_attributes(GLPK.Opt…

[Previous page](https://discourse.julialang.org/latest.md?page=358)

[Next page](https://discourse.julialang.org/latest.md?page=360)
