# Latest

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

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

**Page:** 1222

---

## [Best practice for temporarily loading a package without polluting Manifest.toml and Project.toml?](https://discourse.julialang.org/t/best-practice-for-temporarily-loading-a-package-without-polluting-manifest-toml-and-project-toml/70693)

<div class="topic-metadata">

**Author:** [@robsmith11](https://discourse.julialang.org/u/robsmith11)\
**Replies:** 1\
**Last updated:** [October 31, 2021, 3:50pm UTC](https://discourse.julialang.org/t/best-practice-for-temporarily-loading-a-package-without-polluting-manifest-toml-and-project-toml/70693 "2021-10-31T15:50:35Z")

</div>

Say I’m working on a project and want to plot something so I add a plotting package for looking at some test data. But when my package is actually built and deployed, I don’t want the plotting package and all of its dep…

---

## [What is your favorite mapping package?](https://discourse.julialang.org/t/what-is-your-favorite-mapping-package/70509)

<div class="topic-metadata">

**Author:** [@leon](https://discourse.julialang.org/u/leon)\
**Replies:** 31\
**Last updated:** [October 31, 2021, 3:31pm UTC](https://discourse.julialang.org/t/what-is-your-favorite-mapping-package/70509 "2021-10-31T15:31:08Z")

</div>

My requirements are: Capable of plotting filled contours in the ocean Land areas can be filled with the color of my choice I can choose different mapping projections. There are lots of sample codes available I’m sure …

---

## [Automatically close "Julia Debugger" terminal after program ends](https://discourse.julialang.org/t/automatically-close-julia-debugger-terminal-after-program-ends/56351)

<div class="topic-metadata">

**Author:** [@luc-j-bourhis](https://discourse.julialang.org/u/luc-j-bourhis)\
**Replies:** 1\
**Last updated:** [October 31, 2021, 2:46pm UTC](https://discourse.julialang.org/t/automatically-close-julia-debugger-terminal-after-program-ends/56351 "2021-10-31T14:46:45Z")

</div>

By default, every time a debug session is started, a new terminal “Julia Debugger” is started. When the program finishes, one has to hit “enter” to close it as instructed by the message “Julia debuggee finished. Press EN…

---

## [How does Flux.Conv work?](https://discourse.julialang.org/t/how-does-flux-conv-work/70218)

<div class="topic-metadata">

**Author:** [@pr0physicist](https://discourse.julialang.org/u/pr0physicist)\
**Replies:** 7\
**Last updated:** [October 31, 2021, 1:46pm UTC](https://discourse.julialang.org/t/how-does-flux-conv-work/70218 "2021-10-31T13:46:11Z")

</div>

I was playing around with Flux and tried the Conv layer: julia\> using Flux julia\> l = Conv((1, 5), 1 =\> 1, Flux.sigmoid); julia\> inp = ones(1, 5, 1, 1); julia\> w = l.weight; julia\> b = l.bias; julia\> out1 = l(inp);…

---

## [Why does the command \`run\` fails in this example from the documentation?](https://discourse.julialang.org/t/why-does-the-command-run-fails-in-this-example-from-the-documentation/70686)

<div class="topic-metadata">

**Author:** [@Soldalma](https://discourse.julialang.org/u/Soldalma)\
**Replies:** 1\
**Last updated:** [October 31, 2021, 1:32pm UTC](https://discourse.julialang.org/t/why-does-the-command-run-fails-in-this-example-from-the-documentation/70686 "2021-10-31T13:32:22Z")

</div>

I am trying to learn how to issue shell commands from my Julia program. My OS is Windows 10 but I would also like the commands to run under Linux (Kubuntu). I found the following in the documentation: julia\> mycommand =…

---

## [NeuralPDE.NNODE ODE system solve](https://discourse.julialang.org/t/neuralpde-nnode-ode-system-solve/70538)

<div class="topic-metadata">

**Author:** [@Dr\_M\_Umut\_DEMiREZEN](https://discourse.julialang.org/u/Dr_M_Umut_DEMiREZEN)\
**Replies:** 2\
**Last updated:** [October 31, 2021, 12:15pm UTC](https://discourse.julialang.org/t/neuralpde-nnode-ode-system-solve/70538 "2021-10-31T12:15:41Z")

</div>

Hi, I wanted to use NeuralPDE.NNODE function to solve a coupled ODE system (4 ODE equations) The code is given below : (not given completely) @parameters t @variables k(t) r(t) p(t) c(t) D = Differential(t) eqs = \[D…

---

## [NeualPDE Model Save/Load](https://discourse.julialang.org/t/neualpde-model-save-load/70551)

<div class="topic-metadata">

**Author:** [@Dr\_M\_Umut\_DEMiREZEN](https://discourse.julialang.org/u/Dr_M_Umut_DEMiREZEN)\
**Replies:** 4\
**Last updated:** [October 31, 2021, 12:06pm UTC](https://discourse.julialang.org/t/neualpde-model-save-load/70551 "2021-10-31T12:06:09Z")

</div>

Hi, After training with NeuralPDE framework, how can we save the trained model for further operations? in Flux framework, @save and @load functionas are available and we can save/load the model as a BSON file. But in s…

---

## [Is this a bug (scalar+ranges) with the parser?](https://discourse.julialang.org/t/is-this-a-bug-scalar-ranges-with-the-parser/70670)

<div class="topic-metadata">

**Author:** [@Noel\_Araujo](https://discourse.julialang.org/u/Noel_Araujo)\
**Replies:** 9\
**Last updated:** [October 31, 2021, 9:06am UTC](https://discourse.julialang.org/t/is-this-a-bug-scalar-ranges-with-the-parser/70670 "2021-10-31T09:06:41Z")

</div>

I want to add one scalar value with all value of a unitRange. Naively, I would do the x = 1:5 .+ 0.5 code, but I realize that actually the parser is doing y=1:(5 .+ 0.5). Below a full example: expected = \[1,2,3,4,5\] .+…

---

## [Best practices for "base" packages to define common function names?](https://discourse.julialang.org/t/best-practices-for-base-packages-to-define-common-function-names/70674)

<div class="topic-metadata">

**Author:** [@Alec\_Loudenback](https://discourse.julialang.org/u/Alec_Loudenback)\
**Replies:** 2\
**Last updated:** [October 31, 2021, 6:45am UTC](https://discourse.julialang.org/t/best-practices-for-base-packages-to-define-common-function-names/70674 "2021-10-31T06:45:02Z")

</div>

I have a couple of packages that have functions with the same name, but operate on different structs. Users could definitely have both packages loaded at the same time. I think the best way to prevent issues from confli…

---

## [How to simplify the code in constructing struct](https://discourse.julialang.org/t/how-to-simplify-the-code-in-constructing-struct/70411)

<div class="topic-metadata">

**Author:** [@zhangjin](https://discourse.julialang.org/u/zhangjin)\
**Replies:** 5\
**Last updated:** [October 31, 2021, 3:46am UTC](https://discourse.julialang.org/t/how-to-simplify-the-code-in-constructing-struct/70411 "2021-10-31T03:46:09Z")

</div>

I know the julia don’t have the “class”, but I need it. So I try to use struct to complete it. I try to implement the initialization of inheritance like following code. struct P1 M::Int8 Ks::Int8 metric::St…

---

## [VS Code update 1.61.2 made compilation of my small Julia 1.6.3 programs very snappy on Windows 10](https://discourse.julialang.org/t/vs-code-update-1-61-2-made-compilation-of-my-small-julia-1-6-3-programs-very-snappy-on-windows-10/70644)

<div class="topic-metadata">

**Author:** [@Rolly](https://discourse.julialang.org/u/Rolly)\
**Replies:** 3\
**Last updated:** [October 31, 2021, 2:11am UTC](https://discourse.julialang.org/t/vs-code-update-1-61-2-made-compilation-of-my-small-julia-1-6-3-programs-very-snappy-on-windows-10/70644 "2021-10-31T02:11:25Z")

</div>

I am very impressed. My development cycle has gone from tortuous, to very nice. Thanks ever!!!

---

## [Does the GMT.jl package conflict with the MAT.jl and NCDatasets.jl packages?](https://discourse.julialang.org/t/does-the-gmt-jl-package-conflict-with-the-mat-jl-and-ncdatasets-jl-packages/70639)

<div class="topic-metadata">

**Author:** [@leon](https://discourse.julialang.org/u/leon)\
**Replies:** 13\
**Last updated:** [October 30, 2021, 11:46pm UTC](https://discourse.julialang.org/t/does-the-gmt-jl-package-conflict-with-the-mat-jl-and-ncdatasets-jl-packages/70639 "2021-10-30T23:46:55Z")

</div>

I have a very weird situation. I can plot a map using my GMT.jl package. I can also load my NetCDF data using NCDatasets.jl without any issues. However, if I first use NCDatasets.jl to load the data in and then use GMT.…

---

## [Energy Planning Optimization](https://discourse.julialang.org/t/energy-planning-optimization/70592)

<div class="topic-metadata">

**Author:** [@Lwshalls](https://discourse.julialang.org/u/Lwshalls)\
**Replies:** 4\
**Last updated:** [October 30, 2021, 10:04pm UTC](https://discourse.julialang.org/t/energy-planning-optimization/70592 "2021-10-30T22:04:32Z")

</div>

Hey, Im currently starting my MEng thesis in chemical engineering with my focus on Energy Planning optimization for developing countries. Im developing software to provide guidance for policy makers. My supervisor is …

---

## [How to manually make prediction after training using LIBSVM](https://discourse.julialang.org/t/how-to-manually-make-prediction-after-training-using-libsvm/70669)

<div class="topic-metadata">

**Author:** [@Jaidy](https://discourse.julialang.org/u/Jaidy)\
**Replies:** 0\
**Last updated:** [October 30, 2021, 7:28pm UTC](https://discourse.julialang.org/t/how-to-manually-make-prediction-after-training-using-libsvm/70669 "2021-10-30T19:28:16Z")

</div>

Hi all, I have a dataset X\_train, y\_train that I feed to LIBSVM and get a model using the following code: model = svmtrain(X\_train’, y\_train, kernel = LIBSVM.Kernel.Linear) My question is how to make predictions manua…

---

## [Getting original array index from its view with reduced dimensions](https://discourse.julialang.org/t/getting-original-array-index-from-its-view-with-reduced-dimensions/46822)

<div class="topic-metadata">

**Author:** [@pauljurczak](https://discourse.julialang.org/u/pauljurczak)\
**Replies:** 6\
**Last updated:** [October 30, 2021, 7:17pm UTC](https://discourse.julialang.org/t/getting-original-array-index-from-its-view-with-reduced-dimensions/46822 "2021-10-30T19:17:37Z")

</div>

In this code: a = reshape(collect(1:12), 4, 3) v = view(a, 2, :) for i in eachindex(v) # print corresponding index of array a end I would like to get corresponding original indices of array a, either linear or Carte…

---

## [Optimized code for complex function with Symbolics.jl](https://discourse.julialang.org/t/optimized-code-for-complex-function-with-symbolics-jl/70360)

<div class="topic-metadata">

**Author:** [@mleprovost](https://discourse.julialang.org/u/mleprovost)\
**Replies:** 10\
**Last updated:** [October 30, 2021, 6:33pm UTC](https://discourse.julialang.org/t/optimized-code-for-complex-function-with-symbolics-jl/70360 "2021-10-30T18:33:23Z")

</div>

Hello, I need to write up an optimized code for a nasty analytical expression, the baby version is \\begin{aligned} f\_L = & \\sum\_{J} \\frac{-\\Gamma\_J}{\\pi^2} \\frac{\\text{Im}(z\_J) \\text{Im}(z\_L)}{|x - z\_J|^2|x - z\_L|^2}…

---

## [Efficient trace of product of matrices](https://discourse.julialang.org/t/efficient-trace-of-product-of-matrices/13313)

<div class="topic-metadata">

**Author:** [@garrison](https://discourse.julialang.org/u/garrison)\
**Replies:** 15\
**Last updated:** [October 30, 2021, 5:00pm UTC](https://discourse.julialang.org/t/efficient-trace-of-product-of-matrices/13313 "2021-10-30T17:00:42Z")

</div>

In quantum statistical mechanics, it is common to compute the trace of the product of two (or more) matrices. The obvious way of expressing this in julia is tr(A \* B); however, this results in the computation of all ele…

---

## [Adding calculated columns to dataframe](https://discourse.julialang.org/t/adding-calculated-columns-to-dataframe/70585)

<div class="topic-metadata">

**Author:** [@YummyPampers2](https://discourse.julialang.org/u/YummyPampers2)\
**Replies:** 18\
**Last updated:** [October 30, 2021, 4:51pm UTC](https://discourse.julialang.org/t/adding-calculated-columns-to-dataframe/70585 "2021-10-30T16:51:28Z")

</div>

Hello Folks, I have a DF that constructed as follows: DF = DataFrame(ID = 1:10, Col1 = rand(15:0.01:40,10), Col2 = rand(30:0.01:55,10), Col3 = rand(20:0.01:65,10)...) I am attempting to do the following: Add column…

---

## [Feature request: Can moderators allow us to attach zip files?](https://discourse.julialang.org/t/feature-request-can-moderators-allow-us-to-attach-zip-files/70631)

<div class="topic-metadata">

**Author:** [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Replies:** 15\
**Last updated:** [October 30, 2021, 4:45pm UTC](https://discourse.julialang.org/t/feature-request-can-moderators-allow-us-to-attach-zip-files/70631 "2021-10-30T16:45:18Z")

</div>

We can attach image files but not .zip (or other compressed formats). This would be very handy for some usage examples.

---

## [Avoid ugly 'isempty' pattern](https://discourse.julialang.org/t/avoid-ugly-isempty-pattern/70601)

<div class="topic-metadata">

**Author:** [@nandoconde](https://discourse.julialang.org/u/nandoconde)\
**Replies:** 8\
**Last updated:** [October 30, 2021, 4:37pm UTC](https://discourse.julialang.org/t/avoid-ugly-isempty-pattern/70601 "2021-10-30T16:37:22Z")

</div>

Hello! Through some Discourse posts and my own personal experience, I’ve seen a pattern for isempty that repeats a lot, but there is no easy way around it. It is the case for when the result of a function call returns a…

---

## [Mat2grid question](https://discourse.julialang.org/t/mat2grid-question/70645)

<div class="topic-metadata">

**Author:** [@leon](https://discourse.julialang.org/u/leon)\
**Replies:** 14\
**Last updated:** [October 30, 2021, 3:59pm UTC](https://discourse.julialang.org/t/mat2grid-question/70645 "2021-10-30T15:59:21Z")

</div>

Sorry for the very basic question. Unfortunately, I’m struggling to get it to work. Is below the right way to use mat2grid? My variable A stores the temperature values at a grid that is defined by lon and lat with the si…

---

## [StatsPlot -- axes labels overwrite each other](https://discourse.julialang.org/t/statsplot-axes-labels-overwrite-each-other/70539)

<div class="topic-metadata">

**Author:** [@BLI](https://discourse.julialang.org/u/BLI)\
**Replies:** 18\
**Last updated:** [October 30, 2021, 3:50pm UTC](https://discourse.julialang.org/t/statsplot-axes-labels-overwrite-each-other/70539 "2021-10-30T15:50:21Z")

</div>

I’m plotting some results from a Turing session. Using the Turing recipe, I get: The problem is the tiny variation in the sample value, which makes the density plot look ugly/overlapping (numeric) labels along the ab…

---

## [Machine / Deep Learning with Gene Transcription levels](https://discourse.julialang.org/t/machine-deep-learning-with-gene-transcription-levels/70664)

<div class="topic-metadata">

**Author:** [@jamaas](https://discourse.julialang.org/u/jamaas)\
**Replies:** 0\
**Last updated:** [October 30, 2021, 3:16pm UTC](https://discourse.julialang.org/t/machine-deep-learning-with-gene-transcription-levels/70664 "2021-10-30T15:16:32Z")

</div>

I’m new to Julia, but have used R for many years. I’m embarking on attempting some machine learning, or perhaps deep learning that involves predicting gene transcrition levels from transcription factor binding sites. I…

---

## [DiffEqFlux NaN Bug with Neural ODE: "BoundsError: attempt to access 1-element Vector{Float64} at index \[2\]"](https://discourse.julialang.org/t/diffeqflux-nan-bug-with-neural-ode-boundserror-attempt-to-access-1-element-vector-float64-at-index-2/70596)

<div class="topic-metadata">

**Author:** [@mhr](https://discourse.julialang.org/u/mhr)\
**Replies:** 3\
**Last updated:** [October 30, 2021, 1:58pm UTC](https://discourse.julialang.org/t/diffeqflux-nan-bug-with-neural-ode-boundserror-attempt-to-access-1-element-vector-float64-at-index-2/70596 "2021-10-30T13:58:53Z")

</div>

I’m adapting some code from the following blog post: Differentiable Programming and Neural ODEs for Accelerating Model Based Reinforcement Learning and Optimal Control | by Paul Shen | The Startup | Medium. There’s an o…

---

## [Use package not in current environment for testing/development](https://discourse.julialang.org/t/use-package-not-in-current-environment-for-testing-development/70424)

<div class="topic-metadata">

**Author:** [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Replies:** 12\
**Last updated:** [October 30, 2021, 1:57pm UTC](https://discourse.julialang.org/t/use-package-not-in-current-environment-for-testing-development/70424 "2021-10-30T13:57:30Z")

</div>

There is one part of the development workflow that I may not be doing quite right. When I am developing a package, the environment that package is generally the one activated. Frequently, I have to use, for testing, so…

---

## [\[ANN\] SeqBounds.jl - group sequential design bounds](https://discourse.julialang.org/t/ann-seqbounds-jl-group-sequential-design-bounds/70660)

<div class="topic-metadata">

**Author:** [@PharmCat](https://discourse.julialang.org/u/PharmCat)\
**Replies:** 0\
**Last updated:** [October 30, 2021, 12:54pm UTC](https://discourse.julialang.org/t/ann-seqbounds-jl-group-sequential-design-bounds/70660 "2021-10-30T12:54:51Z")

</div>

SeqBounds.jl - group sequential design bounds calculation for interim analysis - the alpha spending function approach. Reference: Reboussin, D. M., DeMets, D. L., Kim, K., & Lan, K. K. G. (2000). Computations for Gro…

---

## [Single initial value problem for ODE: numerical integration forward and backward](https://discourse.julialang.org/t/single-initial-value-problem-for-ode-numerical-integration-forward-and-backward/70547)

<div class="topic-metadata">

**Author:** [@mocalvao](https://discourse.julialang.org/u/mocalvao)\
**Replies:** 4\
**Last updated:** [October 30, 2021, 10:43am UTC](https://discourse.julialang.org/t/single-initial-value-problem-for-ode-numerical-integration-forward-and-backward/70547 "2021-10-30T10:43:17Z")

</div>

Hi there, I have an ordinary differential equation, such as (mine is much more complicated, besides being a 2-d system): function dxdt!(du, u, p, t) x = u\[1\] du\[1\] = dx = 2\*x^2 end whose general analytical sol…

---

## [How to perform an argmax / argmin on a subset of a vector?](https://discourse.julialang.org/t/how-to-perform-an-argmax-argmin-on-a-subset-of-a-vector/70569)

<div class="topic-metadata">

**Author:** [@erwanlecarpentier](https://discourse.julialang.org/u/erwanlecarpentier)\
**Replies:** 21\
**Last updated:** [October 30, 2021, 8:03am UTC](https://discourse.julialang.org/t/how-to-perform-an-argmax-argmin-on-a-subset-of-a-vector/70569 "2021-10-30T08:03:16Z")

</div>

Hi! Is there a way to perform an argmax on a subset of a vector determined by a bitarray. This bitarray tells whether the index should be considered or not. Example: if my vector is x = \[0, 2, 1, 0\] and the bitarray is b…

---

## [Problem updating a \*single\* package](https://discourse.julialang.org/t/problem-updating-a-single-package/70619)

<div class="topic-metadata">

**Author:** [@erans](https://discourse.julialang.org/u/erans)\
**Replies:** 11\
**Last updated:** [October 30, 2021, 7:51am UTC](https://discourse.julialang.org/t/problem-updating-a-single-package/70619 "2021-10-30T07:51:44Z")

</div>

Hi, I have a non registered package that I added with \] add https://github.com/.../MyPkg.git so that when I do \] status I see: (@v1.6) pkg\> status \[...\] MyPkg v0.1.0 \`https://github.com/.../MyPkg.git#main\` Now, I wo…

---

## [\[1.7-rc2\] Base.promote\_type inference](https://discourse.julialang.org/t/1-7-rc2-base-promote-type-inference/70563)

<div class="topic-metadata">

**Author:** [@OlivierHnt](https://discourse.julialang.org/u/OlivierHnt)\
**Replies:** 3\
**Last updated:** [October 30, 2021, 6:55am UTC](https://discourse.julialang.org/t/1-7-rc2-base-promote-type-inference/70563 "2021-10-30T06:55:21Z")

</div>

On Julia v1.7.0-rc2, Base.promote\_type seems to struggle with type stability for at least the Bool and Irrational types. To illustrate, this shows up in @code\_warntype π \< true, or: julia\> foo() = Base.promote\_type(Boo…

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

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