diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..40f95cd --- /dev/null +++ b/.gitattributes @@ -0,0 +1,221 @@ +# This global .gitattributes file is adhered to via command: +# git config --global core.attributesfile ~/git-global/.gitattributes_global +# +# Use this file on every device where git development is done. + + +### +### Auto detect text files and perform LF normalization +### +# http://davidlaing.com/2012/09/19/customise-your-gitattributes-to-become-a-git-ninja/ +* text=auto + +### +### The above will handle all files NOT found below. +### From https://github.com/alexkaratarakis/gitattributes +### + +### gitattributes/C++.gitattributes d3b93d4 on Jun 20, 2018 +#sources +*.c text diff=cpp +*.cc text diff=cpp +*.cxx text diff=cpp +*.cpp text diff=cpp +*.c++ text diff=cpp +*.hpp text diff=cpp +*.h text diff=cpp +*.h++ text diff=cpp +*.hh text diff=cpp + +# Compiled Object files +*.slo binary +*.lo binary +*.o binary +*.obj binary + +# Precompiled Headers +*.gch binary +*.pch binary + +# Compiled Dynamic libraries +*.so binary +*.dylib binary +*.dll binary + +# Compiled Static libraries +*.lai binary +*.la binary +*.a binary +*.lib binary + +# Executables +*.exe binary +*.out binary +*.app binary + +# Other +############## +*.exe binary +*.num binary +*.xls binary +*.xlsx binary +*.XLS binary +*.XLSX binary +bin/ binary + +### gitattributes/Common.gitattributes 9b38185 on Jun 9, 2018 +# Common settings that generally should always be used with your language specific settings + +# Auto detect text files and perform LF normalization +# http://davidlaing.com/2012/09/19/customise-your-gitattributes-to-become-a-git-ninja/ +* text=auto + +# +# The above will handle all files NOT found below +# + +# Documents +*.doc diff=astextplain +*.DOC diff=astextplain +*.docx diff=astextplain +*.DOCX diff=astextplain +*.dot diff=astextplain +*.DOT diff=astextplain +*.pdf diff=astextplain +*.PDF diff=astextplain +*.rtf diff=astextplain +*.RTF diff=astextplain +*.md text diff=markdown +*.adoc text +*.textile text +*.tex text diff=tex +*.mustache text +*.csv text +*.tab text +*.tsv text +*.sql text + +# Graphics +*.png binary +*.jpg binary +*.jpeg binary +*.gif binary +*.tif binary +*.tiff binary +*.ico binary +# SVG treated as an asset (binary) by default. If you want to treat it as text, +# comment-out the following line and uncomment the line after. +*.svg binary +#*.svg text +*.eps binary + +### gitattributes/Java.gitattributes c08b42f on Mar 29, 2017 +# Handle line endings automatically for files detected as text +# and leave all files detected as binary untouched. +* text=auto + +# +# The above will handle all files NOT found below +# +# These files are text and should be normalized (Convert crlf => lf) +*.css text +*.df text +*.htm text +*.html text +*.java text +*.js text +*.json text +*.jsp text +*.jspf text +*.jspx text +*.properties text +*.sh text +*.tld text +*.txt text +*.tag text +*.tagx text +*.xml text +*.yml text +*.toml text + +# These files are binary and should be left untouched +# (binary is a macro for -text -diff) +*.class binary +*.dll binary +*.ear binary +*.gif binary +*.ico binary +*.jar binary +*.jpg binary +*.jpeg binary +*.png binary +*.so binary +*.war binary + +### gitattributes/Matlab.gitattributes d2539f6 on Dec 3, 2015 +# Basic .gitattributes for a MATLAB repo. +# This template includes Simulink and MuPAD extensions, in addition +# to the MATLAB extensions. + +# Source files +# ============ +*.m text +*.mu text + +# Caution: *.m also matches Mathematica packages. + +# Binary files +# ============ +*.p binary +*.mex* binary +*.fig binary +*.mat binary +*.mdl binary +*.slx binary +*.mdlp binary +*.slxp binary +*.sldd binary +*.mltbx binary +*.mlappinstall binary +*.mlpkginstall binary +*.mn binary + +### gitattributes/Python.gitattributes cbd3af4 on Jun 20, 2018 +# Basic .gitattributes for a python repo. + +# Source files +# ============ +*.pxd text diff=python +*.py text diff=python +*.py3 text diff=python +*.pyw text diff=python +*.pyx text diff=python + +# Binary files +# ============ +*.db binary +*.p binary +*.pkl binary +*.pyc binary +*.pyd binary +*.pyo binary + +# Note: .db, .p, and .pkl files are associated +# with the python modules ``pickle``, ``dbm.*``, +# ``shelve``, ``marshal``, ``anydbm``, & ``bsddb`` +# (among others). + +### gitattributes/R.gitattributes 80aacc1 on Aug 22, 2015 +# Basic .gitattributes for a R repo. + +# Source files +# ============ +*.Rdata text +*.rdb binary +*.rds binary +*.Rd text +*.Rdx binary +*.Rmd text +*.R text + + diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml new file mode 100644 index 0000000..8653d4c --- /dev/null +++ b/.github/workflows/CI.yml @@ -0,0 +1,44 @@ +name: CI +on: + push: + branches: + - main + tags: '*' + pull_request: +concurrency: + # Skip intermediate builds: always. + # Cancel intermediate builds: only if it is a pull request build. + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} +jobs: + test: + name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + version: + - '1' + os: + - ubuntu-latest + arch: + - x64 + steps: + - uses: actions/checkout@v4 + - uses: julia-actions/setup-julia@v1 + with: + version: ${{ matrix.version }} + arch: ${{ matrix.arch }} + - uses: julia-actions/cache@v1 + - uses: julia-actions/julia-buildpkg@v1 + + - name: Run tests + run: > + julia --project=. --color=yes test/runtests.jl + + - name: Generate documentation and deploy + env: # needed for pushing to gh-pages branch + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} + run: > + julia --project=. --color=yes docs/make.jl diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8712726 --- /dev/null +++ b/.gitignore @@ -0,0 +1,416 @@ +################################################################################ +# DrWatson Project Structure # +################################################################################ + +# Folders to ignore - files may be too large, too many, etc. NOTE: EDIT IF NEEDED. +/data +/videos +/plots +/notebooks +/_research + +################################################################################ +# Julia # +################################################################################ + +# Files generated by invoking Julia with --code-coverage +*.jl.cov +*.jl.*.cov + +# Files generated by invoking Julia with --track-allocation +*.jl.mem + +# System-specific files and directories generated by the BinaryProvider and +# BinDeps packages. +# They contain absolute paths, and so should not be committed +deps/deps.jl +deps/build.log +deps/downloads/ +deps/usr/ +deps/src/ + +# Build artifacts for creating documentation generated by the Documenter package +docs/build/ +docs/site/ + +################################################################################ +# Jupyter Notebook # +################################################################################ + +.ipynb_checkpoints +*/.ipynb_checkpoints/* + +################################################################################ +# Microsoft Office # +################################################################################ + +*.tmp + +# Word temporary +~$*.doc* + +# Word Auto Backup File +Backup of *.doc* + +# Excel temporary +~$*.xls* + +# Excel Backup File +*.xlk + +# PowerPoint temporary +~$*.ppt* + +################################################################################ +# LaTeX # +################################################################################ + +## Core latex/pdflatex auxiliary files: +*.aux +*.lof +*.log +*.lot +*.fls +*.out +*.toc +*.fmt +*.fot +*.cb +*.cb2 +.*.lb + +## Intermediate documents: +*.dvi +*.xdv +*-converted-to.* +# these rules will exclude image files for figures, et cetera... +# *.ps +# *.eps +# *.pdf + +## Generated if empty string given at "Please type another file name for output:" +.pdf + +## Bibliography auxiliary files (bibtex/biblatex/biber): +*.bbl +*.bcf +*.blg +*-blx.aux +*-blx.bib +*.run.xml + +## Build tool auxiliary files: +*.fdb_latexmk +*.synctex +*.synctex(busy) +*.synctex.gz +*.synctex.gz(busy) +*.pdfsync + +## Build tool directories for auxiliary files +# latexrun +latex.out/ + +## Auxiliary and intermediate files from other packages: +# algorithms +*.alg +*.loa + +# achemso +acs-*.bib + +# amsthm +*.thm + +# beamer +*.nav +*.pre +*.snm +*.vrb + +# changes +*.soc + +# comment +*.cut + +# cprotect +*.cpt + +# elsarticle (documentclass of Elsevier journals) +*.spl + +# endnotes +*.ent + +# fixme +*.lox + +# feynmf/feynmp +*.mf +*.mp +*.t[1-9] +*.t[1-9][0-9] +*.tfm + +#(r)(e)ledmac/(r)(e)ledpar +*.end +*.?end +*.[1-9] +*.[1-9][0-9] +*.[1-9][0-9][0-9] +*.[1-9]R +*.[1-9][0-9]R +*.[1-9][0-9][0-9]R +*.eledsec[1-9] +*.eledsec[1-9]R +*.eledsec[1-9][0-9] +*.eledsec[1-9][0-9]R +*.eledsec[1-9][0-9][0-9] +*.eledsec[1-9][0-9][0-9]R + +# glossaries +*.acn +*.acr +*.glg +*.glo +*.gls +*.glsdefs + +# gnuplottex +*-gnuplottex-* + +# gregoriotex +*.gaux +*.gtex + +# htlatex +*.4ct +*.4tc +*.idv +*.lg +*.trc +*.xref + +# hyperref +*.brf + +# knitr +*-concordance.tex + +# listings +*.lol + +# luatexja-ruby +*.ltjruby + +# makeidx +*.idx +*.ilg +*.ind +*.ist + +# minitoc +*.maf +*.mlf +*.mlt +*.mtc[0-9]* +*.slf[0-9]* +*.slt[0-9]* +*.stc[0-9]* + +# minted +_minted* +*.pyg + +# morewrites +*.mw + +# nomencl +*.nlg +*.nlo +*.nls + +# pax +*.pax + +# pdfpcnotes +*.pdfpc + +# sagetex +*.sagetex.sage +*.sagetex.py +*.sagetex.scmd + +# scrwfile +*.wrt + +# sympy +*.sout +*.sympy +sympy-plots-for-*.tex/ + +# pdfcomment +*.upa +*.upb + +# pythontex +*.pytxcode +pythontex-files-*/ + +# tcolorbox +*.listing + +# thmtools +*.loe + +# TikZ & PGF +*.dpth +*.md5 +*.auxlock + +# todonotes +*.tdo + +# vhistory +*.hst +*.ver + +# easy-todo +*.lod + +# xcolor +*.xcp + +# xmpincl +*.xmpi + +# xindy +*.xdy + +# xypic precompiled matrices +*.xyc + +# endfloat +*.ttt +*.fff + +# Latexian +TSWLatexianTemp* + +## Editors: +# WinEdt +*.bak +*.sav + +# Texpad +.texpadtmp + +# LyX +*.lyx~ + +# Kile +*.backup + +# KBibTeX +*~[0-9]* + +# auto folder when using emacs and auctex +./auto/* +*.el + +# expex forward references with \gathertags +*-tags.tex + +# standalone packages +*.sta + +### LaTeX Patch ### +# glossaries +*.glstex + +################################################################################ +# Operating systems # +################################################################################ + +######################################## +# Linux # +######################################## + +*~ + +# temporary files which can be created if a process still has a handle open of +# a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + +######################################## +# macOS # +######################################## + +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +######################################## +# Windows # +######################################## + +# Windows thumbnail cache files +Thumbs.db +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + + +## Acknowledgements +# Many thanks to `https://gitignore.io/`, written and maintained by Joe Blau, which contributed much material to this gitignore file. diff --git a/Project.toml b/Project.toml index f58cd7d..d41900f 100644 --- a/Project.toml +++ b/Project.toml @@ -1,3 +1,8 @@ +name = "Linear_Algebra" +authors = ["Aron T"] +[compat] +julia = "1.10.5" +DrWatson = "2.16.0" [deps] Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" DrWatson = "634d3b9d-ee7a-5ddf-bec9-22491ea816e1" diff --git a/README.md b/README.md new file mode 100644 index 0000000..1db4d48 --- /dev/null +++ b/README.md @@ -0,0 +1,40 @@ +# Linear_Algebra + +This code base is using the [Julia Language](https://julialang.org/) and +[DrWatson](https://juliadynamics.github.io/DrWatson.jl/stable/) +to make a reproducible scientific project named +> Linear_Algebra + +It is authored by Aron T. + +To (locally) reproduce this project, do the following: + +0. Download this code base. Notice that raw data are typically not included in the + git-history and may need to be downloaded independently. +1. Open a Julia console and do: + ``` + julia> using Pkg + julia> Pkg.add("DrWatson") # install globally, for using `quickactivate` + julia> Pkg.activate("path/to/this/project") + julia> Pkg.instantiate() + ``` + +This will install all necessary packages for you to be able to run the scripts and +everything should work out of the box, including correctly finding local paths. + +You may notice that most scripts start with the commands: +```julia +using DrWatson +@quickactivate "Linear_Algebra" +``` +which auto-activate the project and enable local path handling from DrWatson. + + + +Some documentation has been set up for this project. It can be viewed by +running the file `docs/make.jl`, and then launching the generated file +`docs/build/index.html`. +Alternatively, the documentation may be already hosted online. +If this is the case it should be at: + +https://ArontTLV.github.io/Linear_Algebra/dev/ diff --git a/docs/make.jl b/docs/make.jl new file mode 100644 index 0000000..2a93357 --- /dev/null +++ b/docs/make.jl @@ -0,0 +1,35 @@ +CI = get(ENV, "CI", nothing) == "true" || get(ENV, "GITHUB_TOKEN", nothing) !== nothing +using DrWatson +@quickactivate "Linear_Algebra" +using Documenter + +# Here you may include files from the source directory +include(srcdir("dummy_src_file.jl")) + +@info "Building Documentation" +makedocs(; + sitename = "Linear_Algebra", + # This argument is only so that the sequence of pages in the sidebar is configured + # By default all markdown files in `docs/src` are expanded and included. + pages = [ + "index.md", + ], + # Don't worry about what `CI` does in this line. + format = Documenter.HTML(prettyurls = CI), +) + +@info "Deploying Documentation" +if CI + deploydocs( + # `repo` MUST be set correctly. Once your GitHub name is set + # the auto-generated documentation will be hosted at: + # https://ArontTLV.github.io/Linear_Algebra/dev/ + # (assuming you have enabled `gh-pages` deployment) + repo = "github.com/ArontTLV/Linear_Algebra.git", + target = "build", + push_preview = true, + devbranch = "main", + ) +end + +@info "Finished with Documentation" diff --git a/docs/src/index.md b/docs/src/index.md new file mode 100644 index 0000000..417052c --- /dev/null +++ b/docs/src/index.md @@ -0,0 +1,14 @@ +# Linear_Algebra +This is the mandatory `index.md` file that is the homepage of the documentation. + +Here the documentation string of a function is expanded: +```@docs +dummy_project_function +``` + +We can link to any subsection name with [Subsection name](@ref). + +We can link to documentation strings with [`dummy_project_function`](@ref). + +## Subsection name +Test. \ No newline at end of file diff --git a/scripts/intro.jl b/scripts/intro.jl new file mode 100644 index 0000000..2edfc36 --- /dev/null +++ b/scripts/intro.jl @@ -0,0 +1,19 @@ +using DrWatson +@quickactivate "Linear_Algebra" + +# Here you may include files from the source directory +include(srcdir("dummy_src_file.jl")) + +println( +""" +Currently active project is: $(projectname()) + +Path of active project: $(projectdir()) + +Have fun with your new project! + +You can help us improve DrWatson by opening +issues on GitHub, submitting feature requests, +or even opening your own Pull Requests! +""" +) diff --git a/src/dummy_src_file.jl b/src/dummy_src_file.jl new file mode 100644 index 0000000..ec8235f --- /dev/null +++ b/src/dummy_src_file.jl @@ -0,0 +1,11 @@ +""" + dummy_project_function(x, y) → z +Dummy function for illustration purposes. +Performs operation: +```math +z = x + y +``` +""" +function dummy_project_function(x, y) + return x + y +end diff --git a/test/runtests.jl b/test/runtests.jl new file mode 100644 index 0000000..7b9196c --- /dev/null +++ b/test/runtests.jl @@ -0,0 +1,17 @@ +using DrWatson, Test +@quickactivate "Linear_Algebra" + +# Here you include files using `srcdir` +# include(srcdir("file.jl")) + +# Run test suite +println("Starting tests") +ti = time() + +@testset "Linear_Algebra tests" begin + @test 1 == 1 +end + +ti = time() - ti +println("\nTest took total time of:") +println(round(ti/60, digits = 3), " minutes")