Creating Julia Modules

Table of Contents

1. Julia

2. Creating Modules

Any person who uses code regularly has had the idea of writing some general piece of code that solves a specific problem and needs to be used in more than one project. Instead of dragging the same piece of code (of arbitrary size), we can create our own module for Julia. This is not different from the modules Plots, Random, etc. Additionally, since Julia is based on Git repositories, the installation of these modules also uses these repositories.

2.1. Creating the module

  • Let us organize all our modules in a general directory myModules, and focus on a module called MixedUtils
  • Inside this directory, the module is automatically generated by running:

    pkg> generate “MixedUtils”

    which automatically creates

    • MixedUtils/Project.toml
    • MixedUtils/src/MixedUtils.jl

2.2. Add tests

Author: Guilherme Telo

Created: 2022-05-03 Tue 17:45