# Latest

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

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

**Page:** 1294

---

## [Use Plots() library to graph a colored surface](https://discourse.julialang.org/t/use-plots-library-to-graph-a-colored-surface/66561)

<div class="topic-metadata">

**Author:** [@Norbert-droid](https://discourse.julialang.org/u/Norbert-droid)\
**Replies:** 8\
**Last updated:** [August 19, 2021, 1:31pm UTC](https://discourse.julialang.org/t/use-plots-library-to-graph-a-colored-surface/66561 "2021-08-19T13:31:07Z")

</div>

I want to make a surface in 3D and color the surface using a fourth coordinate. I want to do this task using Plots and Plotly to rotate the graph at all angles. Here I put examples of the surfaces I want:

---

## [How to define many variables in few lines?](https://discourse.julialang.org/t/how-to-define-many-variables-in-few-lines/65788)

<div class="topic-metadata">

**Author:** [@CRquantum](https://discourse.julialang.org/u/CRquantum)\
**Replies:** 41\
**Last updated:** [August 20, 2021, 7:27am UTC](https://discourse.julialang.org/t/how-to-define-many-variables-in-few-lines/65788 "2021-08-20T07:27:27Z")

</div>

I am very grateful that learned from many guys here that, there is a trick to ‘lock’ the type of a variable by doing a const + Ref trick. Now, if I have many variables, say 100 variables, how to define them in as few li…

---

## [ANN: UnitfulAngles.jl](https://discourse.julialang.org/t/ann-unitfulangles-jl/5254)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 0\
**Last updated:** [August 7, 2017, 9:13am UTC](https://discourse.julialang.org/t/ann-unitfulangles-jl/5254 "2017-08-07T09:13:39Z")

</div>

UnitfulAngles.jl is a supplemental units package for Unitful.jl. Since it’s registered, you can install it by Pkg.add("UnitfulAngles"). UnitfulAngles.jl introduces all the angular units found in Wikipedia’s articles An…

---

## [UnitfulDual.jl - Combining dual numbers with physical units](https://discourse.julialang.org/t/unitfuldual-jl-combining-dual-numbers-with-physical-units/27168)

<div class="topic-metadata">

**Author:** [@AleMorales](https://discourse.julialang.org/u/AleMorales)\
**Replies:** 0\
**Last updated:** [August 5, 2019, 7:38am UTC](https://discourse.julialang.org/t/unitfuldual-jl-combining-dual-numbers-with-physical-units/27168 "2019-08-05T07:38:44Z")

</div>

Not sure where to post this, so I will give it a try here. I write scientific models for my job and I always like to use Unitful.jl to avoid manually tracking unit conversions and also as a basic check that the model is…

---

## [Feedback for small spectroscopic unit conversion package](https://discourse.julialang.org/t/feedback-for-small-spectroscopic-unit-conversion-package/43419)

<div class="topic-metadata">

**Author:** [@Olivier\_Merchiers](https://discourse.julialang.org/u/Olivier_Merchiers)\
**Replies:** 0\
**Last updated:** [July 21, 2020, 8:19am UTC](https://discourse.julialang.org/t/feedback-for-small-spectroscopic-unit-conversion-package/43419 "2020-07-21T08:19:40Z")

</div>

Hello everyone, I’ve made a small package SpectroscopicUnits.jl to help me converting between units commonly used in spectroscopy. It is basically a wrapper around the uconvert function of Unitful.jl and exports a sing…

---

## [\[ANN\] UnitfulRecipes.jl 1.0](https://discourse.julialang.org/t/ann-unitfulrecipes-jl-1-0/45365)

<div class="topic-metadata">

**Author:** [@jw3126](https://discourse.julialang.org/u/jw3126)\
**Replies:** 0\
**Last updated:** [August 22, 2020, 1:35pm UTC](https://discourse.julialang.org/t/ann-unitfulrecipes-jl-1-0/45365 "2020-08-22T13:35:01Z")

</div>

\[ANN\] UnitfulRecipes.jl 1.0 @briochemc and myself are happy to announce UnitfulRecipes.jl 1.0. UnitfulRecipes.jl provides recipes for plotting figures (Plots.jl) when using data with units (Unitful.jl). using Unitful, …

---

## [Interface for loading GBIF datasets into Flux](https://discourse.julialang.org/t/interface-for-loading-gbif-datasets-into-flux/65976)

<div class="topic-metadata">

**Author:** [@banksiaboy](https://discourse.julialang.org/u/banksiaboy)\
**Replies:** 3\
**Last updated:** [August 20, 2021, 6:47am UTC](https://discourse.julialang.org/t/interface-for-loading-gbif-datasets-into-flux/65976 "2021-08-20T06:47:12Z")

</div>

Here is an example of a dataset resulting from my query against the GBIF occurrences database. As you can see it has its own DOI, is well-structured, and should be a good candidate for loading as a data source into Fl…

---

## [How to annotate a groupedbar-plot?](https://discourse.julialang.org/t/how-to-annotate-a-groupedbar-plot/46938)

<div class="topic-metadata">

**Author:** [@Parazetamol](https://discourse.julialang.org/u/Parazetamol)\
**Replies:** 4\
**Last updated:** [August 20, 2021, 6:21am UTC](https://discourse.julialang.org/t/how-to-annotate-a-groupedbar-plot/46938 "2021-08-20T06:21:13Z")

</div>

Hi there, I desperately try to label the individual bars of a groupedbar plot, as in https://matplotlib.org/examples/api/barchart\_demo.html I took some code from a former post https://discourse.julialang.org/t/plots-ba…

---

## [If f = +, why can't I use f as an infix operator (e.g., 2 f 3 == 5)?](https://discourse.julialang.org/t/if-f-why-cant-i-use-f-as-an-infix-operator-e-g-2-f-3-5/66698)

<div class="topic-metadata">

**Author:** [@dgpdx](https://discourse.julialang.org/u/dgpdx)\
**Replies:** 16\
**Last updated:** [August 20, 2021, 4:09am UTC](https://discourse.julialang.org/t/if-f-why-cant-i-use-f-as-an-infix-operator-e-g-2-f-3-5/66698 "2021-08-20T04:09:08Z")

</div>

3 + 4 gives the usual result. f = + followed by 3 f 4 gives an error. Why doesn’t this work?

---

## [Set breakpoint when running from command line](https://discourse.julialang.org/t/set-breakpoint-when-running-from-command-line/66701)

<div class="topic-metadata">

**Author:** [@astrobc1](https://discourse.julialang.org/u/astrobc1)\
**Replies:** 0\
**Last updated:** [August 20, 2021, 3:26am UTC](https://discourse.julialang.org/t/set-breakpoint-when-running-from-command-line/66701 "2021-08-20T03:26:34Z")

</div>

I’d like to set a breakpoint (@bp) when running code from the command line: julia filename.jl where the breakpoint could be inside a function or within the global scope of the file. Is this currently possible via Debugge…

---

## [VS Code is not detecting parent environment](https://discourse.julialang.org/t/vs-code-is-not-detecting-parent-environment/66393)

<div class="topic-metadata">

**Author:** [@usman0311](https://discourse.julialang.org/u/usman0311)\
**Replies:** 10\
**Last updated:** [August 20, 2021, 1:53am UTC](https://discourse.julialang.org/t/vs-code-is-not-detecting-parent-environment/66393 "2021-08-20T01:53:07Z")

</div>

I am using julia 1.6.2 on Windows 10 OS and have installed julia extension in vs code 1.59. But its not detecting parent environment , I have to manually select the environment in .julia folder. Can anyone tell me what …

---

## [Union splitting and AbstractArray](https://discourse.julialang.org/t/union-splitting-and-abstractarray/66692)

<div class="topic-metadata">

**Author:** [@Bardo](https://discourse.julialang.org/u/Bardo)\
**Replies:** 9\
**Last updated:** [August 19, 2021, 10:26pm UTC](https://discourse.julialang.org/t/union-splitting-and-abstractarray/66692 "2021-08-19T22:26:48Z")

</div>

How to select efficiently all types which can directly processed by write()? For scalar types I can use if v isa Real || v is a Char write(io, v) elseif ... An extension to non-scalar types like if v isa AbstractA…

---

## [Type stability for higher derivatives in ForwardDiff](https://discourse.julialang.org/t/type-stability-for-higher-derivatives-in-forwarddiff/66686)

<div class="topic-metadata">

**Author:** [@JonasWickman](https://discourse.julialang.org/u/JonasWickman)\
**Replies:** 2\
**Last updated:** [August 19, 2021, 10:07pm UTC](https://discourse.julialang.org/t/type-stability-for-higher-derivatives-in-forwarddiff/66686 "2021-08-19T22:07:56Z")

</div>

I’m trying to compute all third partial derivatives of a function using ForwardDiff, but cannot get it to be type stable and I don’t understand why. Here is a minimal example: using ForwardDiff using StaticArrays funct…

---

## [Exogenous functions and data in ODE aren't working if modertly complicated](https://discourse.julialang.org/t/exogenous-functions-and-data-in-ode-arent-working-if-modertly-complicated/66678)

<div class="topic-metadata">

**Author:** [@Anthony](https://discourse.julialang.org/u/Anthony)\
**Replies:** 6\
**Last updated:** [August 19, 2021, 10:07pm UTC](https://discourse.julialang.org/t/exogenous-functions-and-data-in-ode-arent-working-if-modertly-complicated/66678 "2021-08-19T22:07:05Z")

</div>

Yesterday I posted about getting control inputs into an ODE and I got great advice. However, I’m running into an issue where the exogenous functions used don’t seem to work if they’re even moderately complicated. Below …

---

## [Operations on NonlinearExpressions](https://discourse.julialang.org/t/operations-on-nonlinearexpressions/66453)

<div class="topic-metadata">

**Author:** [@tonygem96](https://discourse.julialang.org/u/tonygem96)\
**Replies:** 3\
**Last updated:** [August 19, 2021, 9:22pm UTC](https://discourse.julialang.org/t/operations-on-nonlinearexpressions/66453 "2021-08-19T21:22:29Z")

</div>

I am building a user defined function to be optimized in an NLP problem. However NLexpressions cannot be operated on without the @NLexpression macro (eg added, subtracted etc). Is there something wrong with lets say exte…

---

## [Simulating MJPs many times with different parameters as inner loop](https://discourse.julialang.org/t/simulating-mjps-many-times-with-different-parameters-as-inner-loop/49061)

<div class="topic-metadata">

**Author:** [@Sam\_Power](https://discourse.julialang.org/u/Sam_Power)\
**Replies:** 17\
**Last updated:** [August 19, 2021, 7:50pm UTC](https://discourse.julialang.org/t/simulating-mjps-many-times-with-different-parameters-as-inner-loop/49061 "2021-08-19T19:50:25Z")

</div>

Hi, I’m currently coding up a particle filter (a.k.a. Sequential Monte Carlo, among other names) for approximate inference in Chemical Reaction Networks. My dynamics for the propagation of particles will be based on the…

---

## [Setindex! not defined for StepRangeLen](https://discourse.julialang.org/t/setindex-not-defined-for-steprangelen/66667)

<div class="topic-metadata">

**Author:** [@zhangsanle](https://discourse.julialang.org/u/zhangsanle)\
**Replies:** 3\
**Last updated:** [August 19, 2021, 7:50pm UTC](https://discourse.julialang.org/t/setindex-not-defined-for-steprangelen/66667 "2021-08-19T19:50:10Z")

</div>

Hello, I got the following error when I ran the following code：setindex! not defined for StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}} I found out he had run T1. But why is this wrong…

---

## [Best practices with ComponentArrays.jl](https://discourse.julialang.org/t/best-practices-with-componentarrays-jl/66064)

<div class="topic-metadata">

**Author:** [@amrods](https://discourse.julialang.org/u/amrods)\
**Replies:** 1\
**Last updated:** [August 19, 2021, 7:26pm UTC](https://discourse.julialang.org/t/best-practices-with-componentarrays-jl/66064 "2021-08-19T19:26:05Z")

</div>

Suppose I have a model M with parameters θ that are arranged in a ComponentArray. Model M has several components M1 to M2 that each take a subset of components of θ. I’m wondering what’s better, balancing performance and…

---

## [Issue with ModelingToolkit in Pluto](https://discourse.julialang.org/t/issue-with-modelingtoolkit-in-pluto/60517)

<div class="topic-metadata">

**Author:** [@Jon\_Norberg](https://discourse.julialang.org/u/Jon_Norberg)\
**Replies:** 14\
**Last updated:** [August 19, 2021, 6:33pm UTC](https://discourse.julialang.org/t/issue-with-modelingtoolkit-in-pluto/60517 "2021-08-19T18:33:53Z")

</div>

I get the following error for initialising variables. the code runs fine in the terminal and in vscode using the same Julia instance. Any ideas what this could be?

---

## [Composing a function with keyword arguments](https://discourse.julialang.org/t/composing-a-function-with-keyword-arguments/66677)

<div class="topic-metadata">

**Author:** [@zekeriya.sari](https://discourse.julialang.org/u/zekeriya.sari)\
**Replies:** 9\
**Last updated:** [August 19, 2021, 6:31pm UTC](https://discourse.julialang.org/t/composing-a-function-with-keyword-arguments/66677 "2021-08-19T18:31:42Z")

</div>

Hi all, I want to wrap a function with keyword arguments. Here is what I am trying to do, # Wraps \`fk(x)\` with \`d\`, i.e. \`fn(x) = fk(d \* x)\` function wrapper(fk) function fn(x; d = 1) @show d …

---

## [Error when using fit(LinearModel,...) through GLM](https://discourse.julialang.org/t/error-when-using-fit-linearmodel-through-glm/5781)

<div class="topic-metadata">

**Author:** [@IljaK91](https://discourse.julialang.org/u/IljaK91)\
**Replies:** 1\
**Last updated:** [August 19, 2021, 6:14pm UTC](https://discourse.julialang.org/t/error-when-using-fit-linearmodel-through-glm/5781 "2021-08-19T18:14:59Z")

</div>

I want to perform a simple linear regression using this code: fit(LinearModel, @formula(Y ~ t + t2 + t3), regdata) I get the following error message: MethodError: no method matching getindex(::DataFrames.DataFrame, ::…

---

## [Managing Julia packages in a Conda environment by moving JULIA\_DEPOT](https://discourse.julialang.org/t/managing-julia-packages-in-a-conda-environment-by-moving-julia-depot/66685)

<div class="topic-metadata">

**Author:** [@mkitti](https://discourse.julialang.org/u/mkitti)\
**Replies:** 0\
**Last updated:** [August 19, 2021, 5:55pm UTC](https://discourse.julialang.org/t/managing-julia-packages-in-a-conda-environment-by-moving-julia-depot/66685 "2021-08-19T17:55:08Z")

</div>

Julia 1.6.1 is currently in conda-forge and Julia 1.6.2 is on its way. There’s another pull request proposing to add a Conda specific JULIA\_DEPOT location, and I was wondering if anyone else had any thoughts on managing…

---

## [Pkg not updating to latest version of registry](https://discourse.julialang.org/t/pkg-not-updating-to-latest-version-of-registry/65245)

<div class="topic-metadata">

**Author:** [@sglyon](https://discourse.julialang.org/u/sglyon)\
**Replies:** 4\
**Last updated:** [July 26, 2021, 2:01pm UTC](https://discourse.julialang.org/t/pkg-not-updating-to-latest-version-of-registry/65245 "2021-07-26T14:01:35Z")

</div>

I have released a few updates of PlotlyBase. These were released with JuliaRegistrator and the associated PRs have been merged into General. On Github, the latest master branch shows that PlotlyBase has versions through …

---

## [Trying to get the arity of a function](https://discourse.julialang.org/t/trying-to-get-the-arity-of-a-function/66630)

<div class="topic-metadata">

**Author:** [@dgpdx](https://discourse.julialang.org/u/dgpdx)\
**Replies:** 7\
**Last updated:** [August 19, 2021, 3:48pm UTC](https://discourse.julialang.org/t/trying-to-get-the-arity-of-a-function/66630 "2021-08-19T15:48:31Z")

</div>

I written a function to return the arity of a given function: function arity(f) if f == + return 2 # arithmetic functions if f == - return 2 if f == \* return 2 if f == / return 2 if f == ^ return 2 if f == % r…

---

## [Weird applicable behavior](https://discourse.julialang.org/t/weird-applicable-behavior/66679)

<div class="topic-metadata">

**Author:** [@Bardo](https://discourse.julialang.org/u/Bardo)\
**Replies:** 2\
**Last updated:** [August 19, 2021, 3:36pm UTC](https://discourse.julialang.org/t/weird-applicable-behavior/66679 "2021-08-19T15:36:21Z")

</div>

mutable struct Coords x::Float64 y::Float64 z::Float64 end Coords() = Coords(rand(), rand(), rand()) v = Coords() println(v) println(applicable(first, v)) println(first(v)) yields an (expected) error after …

---

## [Organizing many function returns](https://discourse.julialang.org/t/organizing-many-function-returns/66569)

<div class="topic-metadata">

**Author:** [@PatrickMcFarlane](https://discourse.julialang.org/u/PatrickMcFarlane)\
**Replies:** 14\
**Last updated:** [August 19, 2021, 2:27pm UTC](https://discourse.julialang.org/t/organizing-many-function-returns/66569 "2021-08-19T14:27:51Z")

</div>

I’m writing a dynamic optimization algorithm for an economics application with search and matching and unemployment. The algorithm is structured as two functions. There’s an outer function that iterates until finding a…

---

## [Please add a category Usage/Package development](https://discourse.julialang.org/t/please-add-a-category-usage-package-development/40111)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 5\
**Last updated:** [August 19, 2021, 2:15pm UTC](https://discourse.julialang.org/t/please-add-a-category-usage-package-development/40111 "2021-08-19T14:15:21Z")

</div>

I suggest to open a new category (under usage) for package development (including registration). That’s a large but fairly well-focused set of issues that currently would go just under Usage: Please note that this i…

---

## [How to split a matrix in a submatrix of given ranges?](https://discourse.julialang.org/t/how-to-split-a-matrix-in-a-submatrix-of-given-ranges/66642)

<div class="topic-metadata">

**Author:** [@karalis1](https://discourse.julialang.org/u/karalis1)\
**Replies:** 2\
**Last updated:** [August 19, 2021, 1:48pm UTC](https://discourse.julialang.org/t/how-to-split-a-matrix-in-a-submatrix-of-given-ranges/66642 "2021-08-19T13:48:00Z")

</div>

Hi all, I’m trying to implement an algorithm but I can’t figure it out how to split a matrix in a submatrix given some ranges I have tried with views and comprehension but didn’t succed to obtain the given ranges. Th…

---

## [Memory Allocation on Array Element Operations](https://discourse.julialang.org/t/memory-allocation-on-array-element-operations/66676)

<div class="topic-metadata">

**Author:** [@MatthiasSchneller](https://discourse.julialang.org/u/MatthiasSchneller)\
**Replies:** 2\
**Last updated:** [August 19, 2021, 1:44pm UTC](https://discourse.julialang.org/t/memory-allocation-on-array-element-operations/66676 "2021-08-19T13:44:53Z")

</div>

Hi, I currently have the problem that i want to add elements from a Vector to other, more or less random, elements of a matrix. Because i have to do this a lot of times i wanted to improve the performance of it. And tha…

---

## [Jldoctest: expecting (incorrectly) an empty output](https://discourse.julialang.org/t/jldoctest-expecting-incorrectly-an-empty-output/66671)

<div class="topic-metadata">

**Author:** [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Replies:** 3\
**Last updated:** [August 19, 2021, 1:33pm UTC](https://discourse.julialang.org/t/jldoctest-expecting-incorrectly-an-empty-output/66671 "2021-08-19T13:33:07Z")

</div>

I am getting the error below in a jldoctest. The command, when copy/pasted, works perfectly fine. What can be wrong here? #\`\`\`jldoctest │ julia\> using CellListMap │ │ julia\> box = Box(\[ 10 0 0 │ …

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

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