[ANN] Numerics.jl – The Extended Standard Library

Hi All,

Made a package that just reexports the 5 packages most common to Numerics:

  • LinearAlgebra
  • StatsBase
  • Statistics
  • DataFrames
  • DataStructures

If you do:

] add Numerics
using Numerics

You now have access to norm, std, mean, etc. without having to remember which package they come from

// this came about by seeing common struggles from first-time julia users

14 Likes

Link: https://github.com/djsegal/Numerics.jl

1 Like

Wondering if Random and Distributions should be included?

3 Likes

using LinearAlgebra, StaticArrays, SparseArrays
is the first thing I type when I open julia.

4 Likes

I don’t think it makes particular sense to try to find a one-size-fits-all container package. IMO it would make more sense to have a few and to instruct users in the Julia documentation how to use these containers for common tasks. As @Orbots pointed out, the subset of the STDLIB that folks use varies from person to person. I haven’t needed DataFrames yet, for one.

EDIT: Also, teaching people how to create these handy container "using"s would be even more useful. After all, it is nothing but a module. Mine would look like this:

module Numerics

  using Reexport

  @reexport using LinearAlgebra
  @reexport using Statistics
  @reexport using StatsBase
  @reexport using SparseArrays
  @reexport using StaticArrays

end
21 Likes

Maybe there should be something that takes a list of package names and then creates a meta-package for you…a meta-package creating package?

2 Likes

Also valid. That’s the emacs approach. Numerics.jl is the VSCode approach. Both have merit.

But VSCode is just easier.

Like

using LinearAlgebraStatsBaseStatisticsDataFramesDataStructures
4 Likes

Just added Random and SparseArrays to the package’s bundle

The reason I didn’t add Distributions, StaticArrays, etc. is because I wanted Numerics to load in 1s


I’m already keeping a list of slower packages though:

// maybe they can be added if they get faster or have widespread usage

1 Like

Perhaps there should be a basic version of this pacakge that only depends on stdlib modules, so that it could be safely used in any environment, without version compatibility issues.

2 Likes

I think one does not need a package. It is literally just a few lines inside (your own) module (complete code here). Easier to change on the fly whenever your needs change.

7 Likes

Not sure I understand the choice of packages wrt the name… Dataframes isn’t a numerics package, surely, and statistics packages seem a bit peripheral. SpecialFunctions, Hcubature, QuadGK, etc seem a lot more relevant.

9 Likes

I have this kind of stuff in my startup.jl file. Is either of the approaches this thread is about faster/shinier/better?

2 Likes

I personally think this is a pretty bad way to go about solving the problem of people not knowing what packages to import to know where a few functions are. For a limited few that exist by default in the global namespace in other languages (read MATLAB) it has some merit but this includes stuff like DataFrames and DataStructures where you are definitely going to have to read the docs to use so you need to know what packages are in the bundle anyway.

Pretty much the only reason I see for something like this is that if you happen to want to use all the packages that are in the bundle, then it is shorter to write using BundlePackage over the individual packages.

It’s also a bit of a shame that a decent package name got used for something like this.

35 Likes

We have one already.

2 Likes

I think you should have posted this with a disclaimer.

Yeah

I don’t use this myself. I like to know where things come from when I use them to code.
Explicit using everywhere.

But, I don’t work a lot in the REPL. I can see how having a module with all the “usual” stuff may be handy.

I’m a REPL guy and mostly use the same packages all the time. The module would make my startup.jl file a few lines shorter, but I can’t see any other benefits.

Can you explain how you added this in startup?