Made a package that just reexports the 5 packages most common to Numerics:
If you do:
] add Numerics
You now have access to
mean, etc. without having to remember which package they come from
// this came about by seeing common struggles from first-time julia users
Wondering if Random and Distributions should be included?
using LinearAlgebra, StaticArrays, SparseArrays
is the first thing I type when I open julia.
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:
@reexport using LinearAlgebra
@reexport using Statistics
@reexport using StatsBase
@reexport using SparseArrays
@reexport using StaticArrays
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?
Also valid. That’s the emacs approach. Numerics.jl is the VSCode approach. Both have merit.
But VSCode is just easier.
SparseArrays to the package’s bundle
The reason I didn’t add Distributions, StaticArrays, etc. is because I wanted
Numerics to load in
I’m already keeping a list of slower packages though:
// maybe they can be added if they get faster or have widespread usage
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.
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.
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.
I have this kind of stuff in my startup.jl file. Is either of the approaches this thread is about faster/shinier/better?
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.
I think you should have posted this with a disclaimer.
I don’t use this myself. I like to know where things come from when I use them to code.
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?