# General Usage

**URL:** https://discourse.julialang.org/c/usage/6.md?page=626

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

**Page:** 627

---

## [Overriding default proxy setup in Julia for Windows](https://discourse.julialang.org/t/overriding-default-proxy-setup-in-julia-for-windows/57159)

<div class="topic-metadata">

**Author:** [@wsshin](https://discourse.julialang.org/u/wsshin)\
**Replies:** 2\
**Last updated:** [March 18, 2021, 2:29am UTC](https://discourse.julialang.org/t/overriding-default-proxy-setup-in-julia-for-windows/57159 "2021-03-18T02:29:16Z")

</div>

I am a Mac user, but need to test Julia on Windows for my work at the job. During pkg\> add PyCall, I get the following error message during the build procedure (reproduced by pkg\> build PyCall): pkg\> build PyCall …

---

## [Slow gzip streaming in julia but not in python](https://discourse.julialang.org/t/slow-gzip-streaming-in-julia-but-not-in-python/56346)

<div class="topic-metadata">

**Author:** [@calvin](https://discourse.julialang.org/u/calvin)\
**Replies:** 19\
**Last updated:** [March 18, 2021, 2:18am UTC](https://discourse.julialang.org/t/slow-gzip-streaming-in-julia-but-not-in-python/56346 "2021-03-18T02:18:05Z")

</div>

Hi there, I am new to Julia, and come to Julia for performance with fewer codes. I have been using R, and encountered a simple task: read from a gziped file and do something to each line. It was slow in R, of course. So…

---

## [PyCall giving Ptr instead of PyObject](https://discourse.julialang.org/t/pycall-giving-ptr-instead-of-pyobject/57422)

<div class="topic-metadata">

**Author:** [@Satvik](https://discourse.julialang.org/u/Satvik)\
**Replies:** 2\
**Last updated:** [March 18, 2021, 1:53am UTC](https://discourse.julialang.org/t/pycall-giving-ptr-instead-of-pyobject/57422 "2021-03-18T01:53:00Z")

</div>

Hi, I’m trying to load a python file that was pickled using joblib. The file is a python dict that contains several objects, including a few DataFrames. When I load the dict in Python it’s fine, but when I try to load i…

---

## [Too much allocations](https://discourse.julialang.org/t/too-much-allocations/57366)

<div class="topic-metadata">

**Author:** [@powerzf](https://discourse.julialang.org/u/powerzf)\
**Replies:** 4\
**Last updated:** [March 18, 2021, 12:33am UTC](https://discourse.julialang.org/t/too-much-allocations/57366 "2021-03-18T00:33:59Z")

</div>

abstract type CVGSurface end struct Triangle \<: CVGSurface triangleID :: Int64 x :: Float64 y :: Float64 z :: Float64 end Triangle() = Triangle(1,1.0,1.0,1.0) struct TrBoundry \<:CVGSurface tri…

---

## [Read a dictionary JLD2 file dumped by python in julia](https://discourse.julialang.org/t/read-a-dictionary-jld2-file-dumped-by-python-in-julia/57418)

<div class="topic-metadata">

**Author:** [@Sebastian\_Mena](https://discourse.julialang.org/u/Sebastian_Mena)\
**Replies:** 3\
**Last updated:** [March 17, 2021, 10:17pm UTC](https://discourse.julialang.org/t/read-a-dictionary-jld2-file-dumped-by-python-in-julia/57418 "2021-03-17T22:17:04Z")

</div>

Hi, I am trying to import a dictionary that I saved in python with the extension .jld2 First, I tried this code to do that: \> using JSON \> using DataStructures \> using JLD2 \> dict\_name = load("path/dict\_name.jld2") A…

---

## [Is it possible to write something like:\`\`\`op = :(&amp;&amp;)set = AndSet@eval f](https://discourse.julialang.org/t/is-it-possible-to-write-something-like-op-amp-amp-set-andset-eval-f/57417)

<div class="topic-metadata">

**Author:** [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)\
**Replies:** 1\
**Last updated:** [March 17, 2021, 10:04pm UTC](https://discourse.julialang.org/t/is-it-possible-to-write-something-like-op-amp-amp-set-andset-eval-f/57417 "2021-03-17T22:04:51Z")

</div>

is it possible to write something like: op = :(&&) set = AndSet @eval do\_some\_operation(::$set, lhs, rhs) = lhs $op $rhs ? The $op part does not get parsed as hoped. Any way to rewrite this to make it possible? Note t…

---

## [Performance of a key step in Strang Splitting method](https://discourse.julialang.org/t/performance-of-a-key-step-in-strang-splitting-method/57312)

<div class="topic-metadata">

**Author:** [@jacobusmmsmit](https://discourse.julialang.org/u/jacobusmmsmit)\
**Replies:** 10\
**Last updated:** [March 17, 2021, 8:39pm UTC](https://discourse.julialang.org/t/performance-of-a-key-step-in-strang-splitting-method/57312 "2021-03-17T20:39:08Z")

</div>

Hello, My friend is working on a problem solving a 3+1 Dimensional non-linear PDE using a two-step operator splitting scheme. His code is in MATLAB and I suggested he try out Julia as it gives you more of a toolkit to o…

---

## [Return type of \`sum\` with nested function is inferred as \`Any\`](https://discourse.julialang.org/t/return-type-of-sum-with-nested-function-is-inferred-as-any/57407)

<div class="topic-metadata">

**Author:** [@Uroc327](https://discourse.julialang.org/u/Uroc327)\
**Replies:** 6\
**Last updated:** [March 17, 2021, 8:30pm UTC](https://discourse.julialang.org/t/return-type-of-sum-with-nested-function-is-inferred-as-any/57407 "2021-03-17T20:30:40Z")

</div>

I have a function that sums over expressions calling nested functions. I noticed that the function runs rather slowly. Upon further investigation, julia seems to be unable to infer the return type of this function. The …

---

## [LoadError: MethodError: Cannot \`convert\` an object of type Array{Float64,2} to an object of type EasyFITS.FitsImage{Float64,2}](https://discourse.julialang.org/t/loaderror-methoderror-cannot-convert-an-object-of-type-array-float64-2-to-an-object-of-type-easyfits-fitsimage-float64-2/57097)

<div class="topic-metadata">

**Author:** [@assia855](https://discourse.julialang.org/u/assia855)\
**Replies:** 4\
**Last updated:** [March 17, 2021, 8:20pm UTC](https://discourse.julialang.org/t/loaderror-methoderror-cannot-convert-an-object-of-type-array-float64-2-to-an-object-of-type-easyfits-fitsimage-float64-2/57097 "2021-03-17T20:20:48Z")

</div>

LoadError: MethodError: Cannot convert an object of type Array{Float64,2} to an object of type EasyFITS.FitsImage{Float64,2} Closest candidates are: convert(::Type{#s15} where #s15\<:AbstractArray, ::EasyFITS.FitsImage)…

---

## [Vectorization when broadcasting vector of structs](https://discourse.julialang.org/t/vectorization-when-broadcasting-vector-of-structs/57410)

<div class="topic-metadata">

**Author:** [@gbaraldi](https://discourse.julialang.org/u/gbaraldi)\
**Replies:** 0\
**Last updated:** [March 17, 2021, 8:02pm UTC](https://discourse.julialang.org/t/vectorization-when-broadcasting-vector-of-structs/57410 "2021-03-17T20:02:11Z")

</div>

Recently on slack I was discussing about the performance of generic structs and whether or not they should be vectorized and while exploring I found some interesting results. using BenchmarkTools struct TestType{𝒯} …

---

## [Set array dimensions in composite type](https://discourse.julialang.org/t/set-array-dimensions-in-composite-type/57123)

<div class="topic-metadata">

**Author:** [@weymouth](https://discourse.julialang.org/u/weymouth)\
**Replies:** 14\
**Last updated:** [March 17, 2021, 7:52pm UTC](https://discourse.julialang.org/t/set-array-dimensions-in-composite-type/57123 "2021-03-17T19:52:14Z")

</div>

How can you define arrays of increasing dimension in a composite type when they have a simple form such as the following? struct compound{N} # N is the number of spatial dimensions of the field scalar\_field :: Array…

---

## [Is there a direct Julia equivalent of Rust's \`retain()\` method?](https://discourse.julialang.org/t/is-there-a-direct-julia-equivalent-of-rusts-retain-method/57391)

<div class="topic-metadata">

**Author:** [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)\
**Replies:** 2\
**Last updated:** [March 17, 2021, 3:43pm UTC](https://discourse.julialang.org/t/is-there-a-direct-julia-equivalent-of-rusts-retain-method/57391 "2021-03-17T15:43:33Z")

</div>

Is there a direct Julia equivalent of Rust’s retain() method? Note that the original poster on Slack cannot see your response here on Discourse. Consider transcribing the appropriate answer back to Slack, or pinging the…

---

## [Avoiding allocations for function arguments with non-concrete types](https://discourse.julialang.org/t/avoiding-allocations-for-function-arguments-with-non-concrete-types/57263)

<div class="topic-metadata">

**Author:** [@Nicholaswogan](https://discourse.julialang.org/u/Nicholaswogan)\
**Replies:** 8\
**Last updated:** [March 17, 2021, 6:34pm UTC](https://discourse.julialang.org/t/avoiding-allocations-for-function-arguments-with-non-concrete-types/57263 "2021-03-17T18:34:46Z")

</div>

Hi, I am beginning to learn how to build my own types, and pass them to functions with different methods for different input types. Below is a chemistry example problem. I do not understand one of the allocations involve…

---

## [ANN: LoopVectorization 0.12: multithreading and better handling of discontiguous memory accesses](https://discourse.julialang.org/t/ann-loopvectorization-0-12-multithreading-and-better-handling-of-discontiguous-memory-accesses/57262)

<div class="topic-metadata">

**Author:** [@Elrod](https://discourse.julialang.org/u/Elrod)\
**Replies:** 16\
**Last updated:** [March 17, 2021, 4:25pm UTC](https://discourse.julialang.org/t/ann-loopvectorization-0-12-multithreading-and-better-handling-of-discontiguous-memory-accesses/57262 "2021-03-17T16:25:48Z")

</div>

I thought LoopVectorization 0.12 brought enough exciting improvements to warrant an update. Probably most exciting is the addition of @avxt or equivalently @avx thread=true, which can automatically multithread for loops…

---

## [Access variale between testsets](https://discourse.julialang.org/t/access-variale-between-testsets/57390)

<div class="topic-metadata">

**Author:** [@Michal](https://discourse.julialang.org/u/Michal)\
**Replies:** 2\
**Last updated:** [March 17, 2021, 3:15pm UTC](https://discourse.julialang.org/t/access-variale-between-testsets/57390 "2021-03-17T15:15:56Z")

</div>

How can I take result from first testset and use it in second testset? global result = 0; @time @testset verbose=true "Upload" begin println(result) result = 1 end @time @testset verbose=true "Update" begin …

---

## [Abstract parametric constructors](https://discourse.julialang.org/t/abstract-parametric-constructors/57387)

<div class="topic-metadata">

**Author:** [@Wikunia](https://discourse.julialang.org/u/Wikunia)\
**Replies:** 5\
**Last updated:** [March 17, 2021, 2:35pm UTC](https://discourse.julialang.org/t/abstract-parametric-constructors/57387 "2021-03-17T14:35:04Z")

</div>

How can I create a constructor for a parametric type using its abstract supertype? This is my minimal nonworking example :wink: abstract type MyNumber{T1\<:Integer,T2\<:Integer} end struct MyNumber1{T1,T2} \<: MyNumber{T…

---

## [Saving/Loading folders with DrWatson.jl](https://discourse.julialang.org/t/saving-loading-folders-with-drwatson-jl/56741)

<div class="topic-metadata">

**Author:** [@gobs](https://discourse.julialang.org/u/gobs)\
**Replies:** 7\
**Last updated:** [March 17, 2021, 1:58pm UTC](https://discourse.julialang.org/t/saving-loading-folders-with-drwatson-jl/56741 "2021-03-17T13:58:42Z")

</div>

Hello! I started trying DrWatson out in the hope of tidying up my currently very messy workflow. I’ve run into a problem however - I save two custom types by saving various .csv and .yaml files into a folder. I then load…

---

## [I have some nice custom prinitng of an array, but I want to configure the operatio](https://discourse.julialang.org/t/i-have-some-nice-custom-prinitng-of-an-array-but-i-want-to-configure-the-operatio/57384)

<div class="topic-metadata">

**Author:** [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)\
**Replies:** 1\
**Last updated:** [March 17, 2021, 1:56pm UTC](https://discourse.julialang.org/t/i-have-some-nice-custom-prinitng-of-an-array-but-i-want-to-configure-the-operatio/57384 "2021-03-17T13:56:07Z")

</div>

I have some nice custom prinitng of an array, but I want to configure the operation Base.print\_matrix(IOContext(io, :compact =&gt; true, :limit =&gt; true), A) so that it takes less rows that the fully available rows of …

---

## [Possible bug using plan\_irfft and plan\_rfft with mul! and ldiv!](https://discourse.julialang.org/t/possible-bug-using-plan-irfft-and-plan-rfft-with-mul-and-ldiv/57374)

<div class="topic-metadata">

**Author:** [@tiago](https://discourse.julialang.org/u/tiago)\
**Replies:** 2\
**Last updated:** [March 17, 2021, 1:54pm UTC](https://discourse.julialang.org/t/possible-bug-using-plan-irfft-and-plan-rfft-with-mul-and-ldiv/57374 "2021-03-17T13:54:32Z")

</div>

Hello, I found a strange behaviour while using precomputed plans in 2D of real fft, plan\_rfft and plan\_irfft, with the function mul! and ldiv! from the LinearAlbegra package. For example, when computing the inverse tran…

---

## [@code\_warntype does not warn about Array{Any}](https://discourse.julialang.org/t/code-warntype-does-not-warn-about-array-any/57191)

<div class="topic-metadata">

**Author:** [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Replies:** 11\
**Last updated:** [March 17, 2021, 1:00pm UTC](https://discourse.julialang.org/t/code-warntype-does-not-warn-about-array-any/57191 "2021-03-17T13:00:06Z")

</div>

Shouldn’t @code\_warntype flag (in red) the fact that the return value of this function is an array of Any? The macro notes the Any, but does not make it red. struct T x::Int32 y::Int32 end function test\_warnty…

---

## [Organisation of a diverse library in submodules using Reexport and ForceImport](https://discourse.julialang.org/t/organisation-of-a-diverse-library-in-submodules-using-reexport-and-forceimport/57377)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 0\
**Last updated:** [March 17, 2021, 12:50pm UTC](https://discourse.julialang.org/t/organisation-of-a-diverse-library-in-submodules-using-reexport-and-forceimport/57377 "2021-03-17T12:50:35Z")

</div>

I have a Machine Learning library with different stuff that I am keeping organised in submodules. I use submodules because (1) They actually make “logical” sense to classify them in submodules; (2) They integrate nicely …

---

## [Does @benchmark accurately track PyCall allocations?](https://discourse.julialang.org/t/does-benchmark-accurately-track-pycall-allocations/57375)

<div class="topic-metadata">

**Author:** [@mihalybaci](https://discourse.julialang.org/u/mihalybaci)\
**Replies:** 2\
**Last updated:** [March 17, 2021, 12:41pm UTC](https://discourse.julialang.org/t/does-benchmark-accurately-track-pycall-allocations/57375 "2021-03-17T12:41:37Z")

</div>

In the few instances I have tried to compare PyCall+@benchmark versus timteit within Python, I get runtimes that are very similar (occasionally timing Python from Julia is 1-2 ms faster for some reason). But, does @bench…

---

## [No method matching iterate(::XLSX.Worksheet)](https://discourse.julialang.org/t/no-method-matching-iterate-xlsx-worksheet/57371)

<div class="topic-metadata">

**Author:** [@Yaropro14](https://discourse.julialang.org/u/Yaropro14)\
**Replies:** 1\
**Last updated:** [March 17, 2021, 12:14pm UTC](https://discourse.julialang.org/t/no-method-matching-iterate-xlsx-worksheet/57371 "2021-03-17T12:14:15Z")

</div>

file = XLSX.readxlsx(“ASG data 14.06.2018 (new data).xlsx”) f\_curves = file\[“Curves”\] DP = f\_curves\[“C48:C56”\] # (old) peak power consumption forecast by 2035, GW Seasons = f\_curves\[“B28:E36”\] D=Seasons.\*DP f\_gen\_an…

---

## [Question about Interval Root finding](https://discourse.julialang.org/t/question-about-interval-root-finding/57124)

<div class="topic-metadata">

**Author:** [@TheLateKronos](https://discourse.julialang.org/u/TheLateKronos)\
**Replies:** 7\
**Last updated:** [March 17, 2021, 8:17am UTC](https://discourse.julialang.org/t/question-about-interval-root-finding/57124 "2021-03-17T08:17:01Z")

</div>

So I am using IntervalRootFinding.jl to find out how many possibly energy states exist for a finite potential well (Quantum mechanichs). The problem is that when I look for roots from -1e100 to 1e100, I get 2 solutions, …

---

## [What's the big deal? 0 vs 1 based indexing](https://discourse.julialang.org/t/whats-the-big-deal-0-vs-1-based-indexing/1102)

<div class="topic-metadata">

**Author:** [@pyrex41](https://discourse.julialang.org/u/pyrex41)\
**Replies:** 13\
**Last updated:** [March 17, 2021, 7:04am UTC](https://discourse.julialang.org/t/whats-the-big-deal-0-vs-1-based-indexing/1102 "2021-03-17T07:04:13Z")

</div>

As an engineer coming from a non CS / EE background, I have no strong preference or use for 0 based indexing. In fact, 1 based indexing seems incredibly intuitive to me when I use Julia to work with data and manipulate a…

---

## [PyError. Can't use ExcelReaders](https://discourse.julialang.org/t/pyerror-cant-use-excelreaders/57247)

<div class="topic-metadata">

**Author:** [@Yaropro14](https://discourse.julialang.org/u/Yaropro14)\
**Replies:** 6\
**Last updated:** [March 16, 2021, 6:32pm UTC](https://discourse.julialang.org/t/pyerror-cant-use-excelreaders/57247 "2021-03-16T18:32:21Z")

</div>

PyError ($(Expr(:escape, :(ccall(#= /Users/yaroslav/.julia/packages/PyCall/tqyST/src/pyfncall.jl:43 =# @pysym(:PyObject\_Call), PyPtr, (PyPtr, PyPtr, PyPtr), o, pyargsptr, kw))))) \<class ‘xlrd.biffh.XLRDError’\> XLRDError…

---

## [MethodError Exception, GtkReactive drawing.jl example using Debugger](https://discourse.julialang.org/t/methoderror-exception-gtkreactive-drawing-jl-example-using-debugger/57317)

<div class="topic-metadata">

**Author:** [@nelsonah](https://discourse.julialang.org/u/nelsonah)\
**Replies:** 0\
**Last updated:** [March 16, 2021, 5:00pm UTC](https://discourse.julialang.org/t/methoderror-exception-gtkreactive-drawing-jl-example-using-debugger/57317 "2021-03-16T17:00:56Z")

</div>

I was trying to use the debugger to understand GtkReacttive coding. I stripped down the drawing.jl example as follows: File: drawing.jl from https://raw.githubusercontent.com/JuliaGizmos/GtkReactive.jl/master/examples…

---

## [Incorrect console output for nested @testset](https://discourse.julialang.org/t/incorrect-console-output-for-nested-testset/57198)

<div class="topic-metadata">

**Author:** [@Michal](https://discourse.julialang.org/u/Michal)\
**Replies:** 5\
**Last updated:** [March 16, 2021, 4:28pm UTC](https://discourse.julialang.org/t/incorrect-console-output-for-nested-testset/57198 "2021-03-16T16:28:06Z")

</div>

I created nested @testsets with tests. In general, it is running correct for all tests, but console output is not same as I expected from following website. I tried it on Julia 1.5.2, 1.5.4, 1.6RC. https://docs.julialan…

---

## [DEDataArrays on GPU](https://discourse.julialang.org/t/dedataarrays-on-gpu/56312)

<div class="topic-metadata">

**Author:** [@fedoroff](https://discourse.julialang.org/u/fedoroff)\
**Replies:** 3\
**Last updated:** [March 16, 2021, 3:19pm UTC](https://discourse.julialang.org/t/dedataarrays-on-gpu/56312 "2021-03-16T15:19:30Z")

</div>

Following this discussion I have a question about the possibility of using DEDataArrays on GPU. Currently, I can not convert a DEDataArray A simply as CuArray(A), since the CuArray function will omit all extra fields of A…

---

## [ExcelReaders function openxl](https://discourse.julialang.org/t/excelreaders-function-openxl/57303)

<div class="topic-metadata">

**Author:** [@Yaropro14](https://discourse.julialang.org/u/Yaropro14)\
**Replies:** 3\
**Last updated:** [March 16, 2021, 3:07pm UTC](https://discourse.julialang.org/t/excelreaders-function-openxl/57303 "2021-03-16T15:07:18Z")

</div>

using ExcelReaders, JuMP, Plots, Gurobi cd(“/Users/yaroslav/Desktop/Diplom/”) file5=openxl(“ASG data 14.06.2018 (new data).xlsx”) PyError ($(Expr(:escape, :(ccall(#= /Users/yaroslav/.julia/packages/PyCall/tqyST/src/py…

[Previous page](https://discourse.julialang.org/c/usage/6.md?page=625)

[Next page](https://discourse.julialang.org/c/usage/6.md?page=627)
