From ff99bbcc78c7f96cfd4b78622971b2574b71755e Mon Sep 17 00:00:00 2001 From: Pedram Ashofteh Ardakani Date: Sun, 3 May 2020 14:43:19 +0430 Subject: tutorial: improved formatting * use # some comment * remove extra tags --- tutorial.html | 84 +++++++++++++++++++++++++++++------------------------------ 1 file changed, 42 insertions(+), 42 deletions(-) (limited to 'tutorial.html') diff --git a/tutorial.html b/tutorial.html index a911fcc..da2476a 100644 --- a/tutorial.html +++ b/tutorial.html @@ -122,8 +122,8 @@ reproduce/software/config/installation/TARGETS.mk and add to the top-level-python line, the word matplotlib.

-
# Python libraries/modules.
-                    top-level-python    = astropy matplotlib
+
# Python libraries/modules.
+top-level-python    = astropy matplotlib

After that, run the configure step again with the option -e to continue using the same configuration options given before (input and build @@ -147,12 +147,12 @@ Finally, as this is the very first commit of the project, tag this as the zero-th version.

-
git status         # See which files have been changed.
-git diff           # See the lines you have modified.
-git add -u         # Put all tracked changes in staging area.
-git status         # Make sure everything is fine.
-git commit         # Your first commit, add a nice description.
-git tag -a v0.0    # Tag this as the zero-th version of your project.
+
git status         # See which files have been changed.
+git diff           # See the lines you have modified.
+git add -u         # Put all tracked changes in staging area.
+git status         # Make sure everything is fine.
+git commit         # Your first commit, add a nice description.
+git tag -a v0.0    # Tag this as the zero-th version of your project.

Now, have a look at the Git history of the project. Note that the local master branch is one commit above than the remote origin/master branch. @@ -160,9 +160,9 @@ git tag -a v0.0 # Tag this as the zero-th version of your project.master branch to follow origin/master, you can just use git push.

-
git log --oneline --decorate --all --graph   # Have a look at the Git history.
-git push                                     # Push the commit to the remote/origin.
-git push --tags                              # Push all tags to the remote/origin.
+
git log --oneline --decorate --all --graph   # Have a look at the Git history.
+git push                                     # Push the commit to the remote/origin.
+git push --tags                              # Push all tags to the remote/origin.

Now it is time to start including your own scripts to download and make the analysis of the data. It is important to bear in mind that the goal of this @@ -207,25 +207,25 @@ git push --tags # Push all tags to the remote/origi into the directory generated in the above step (reproduce/analysis/python).

-
# Make a linear fit of an input data set
-# This Python script makes a linear fitting of a data consisting in time and
-# population. It generates a figure in which the original data and the
-# fitted curve is plotted.  Finally, it saves the fitting parameters.
-# Original author:
-# Copyright (C) 2020, Raul Infante-Sainz infantesainz@gmail.com
-# Contributing author(s):
-# Copyright (C) YEAR, YourName YourSurname.
-#
-# This Python script is free software: you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation, either version 3 of the License, or (at your
-# option) any later version.
-#
-# This Python script is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
-# Public License for more details. See http://www.gnu.org/licenses/.
-# Necessary packages
+                
# Make a linear fit of an input data set
+# This Python script makes a linear fitting of a data consisting in time and
+# population. It generates a figure in which the original data and the
+# fitted curve is plotted.  Finally, it saves the fitting parameters.
+# Original author:
+# Copyright (C) 2020, Raul Infante-Sainz infantesainz@gmail.com
+# Contributing author(s):
+# Copyright (C) YEAR, YourName YourSurname.
+#
+# This Python script is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation, either version 3 of the License, or (at your
+# option) any later version.
+#
+# This Python script is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
+# Public License for more details. See http://www.gnu.org/licenses/.
+# Necessary packages
 
 import sys
 import numpy as np
@@ -239,9 +239,9 @@ return a * x + b
 
 # Define input and output arguments
 
-ifile = sys.argv[1]    # Input file
-ofile = sys.argv[2]    # Output file
-ofig  = sys.argv[3]    # Output figure
+ifile = sys.argv[1]    # Input file
+ofile = sys.argv[2]    # Output file
+ofig  = sys.argv[3]    # Output figure
 
 # Read the data from the input file.
 
@@ -302,17 +302,17 @@ np.savetxt(ofile, params, fmt='%.3f')
                 information, comments or clarify any step. After that, add the files and
                 commit the work. Finally, push the commit to the remote/origin.

-
git status                                       # See which files you have changed.
-git diff                                         # See the lines you have added/changed.
-git add reproduce/analysis/python/linear-fit.py  # Put all tracked changes in staging area.
-git commit                                       # Commit, add a nice descriptions.
-git push                                         # Push the commit to the remote/origin.
+
git status                                       # See which files you have changed.
+git diff                                         # See the lines you have added/changed.
+git add reproduce/analysis/python/linear-fit.py  # Put all tracked changes in staging area.
+git commit                                       # Commit, add a nice descriptions.
+git push                                         # Push the commit to the remote/origin.

Check that everything is fine having a look at the Git history of the project. Note that the master branch has been increased in one commit, while the template branch is behind.

-
git log --oneline --decorate --all --graph  # See the `Git` history.
+
git log --oneline --decorate --all --graph  # See the `Git` history.

In short: in this section you have included a Python script that will be used for making the linear fitting.

@@ -600,14 +600,14 @@ echo "\newcommand{\bfitparam}{$$b}" >> $@
# The input file is defined and downloaded using the following rule pop-data = $(indir)/ESP.dat $(pop-data): | $(indir) -# Use wget to download the data +# Use wget to download the data wget http://akhlaghi.org/data/template-tutorial/ESP.dat -O $@ # Output directory # ---------------- # Small rule for constructing the output directory, previously defined odir = $(BDIR)/fit-parameters $(odir): -# Build the output directory +# Build the output directory mkdir $@ # Linear fitting of the data # -------------------------- @@ -615,7 +615,7 @@ mkdir $@ # parameters will be saved into this directory by the Python script. param-file = $(odir)/ESP.txt $(param-file): $(indir)/ESP.dat | $(odir) -# Invoke Python to run the script with the input data +# Invoke Python to run the script with the input data python reproduce/analysis/python/linear-fit.py $< $@ $(odir)/ESP.pdf # TeX macros final target # ----------------------- -- cgit v1.2.1