From 5d0b7731384c2a2b2bf410bc90e542300f0a0ad3 Mon Sep 17 00:00:00 2001 From: Christian Kolset Date: Thu, 13 Feb 2025 19:25:10 -0700 Subject: renamed files to contain numbering --- tutorials/1_01_intro_to_programming.md | 15 ++ tutorials/1_02_installing_anaconda.md | 56 ++++++++ tutorials/1_03_intro_to_anaconda.md | 60 ++++++++ tutorials/1_04_spyder_getting_started.md | 27 ++++ tutorials/1_05_basics_of_python.md | 141 +++++++++++++++++++ tutorials/1_06_arrays.md | 46 ++++++ tutorials/1_07_control_structures.md | 10 ++ tutorials/1_classes_and_objects.md | 8 ++ tutorials/1_computing_fundamentals.md | 15 ++ tutorials/1_functions.md | 29 ++++ tutorials/1_fundamentals_of_programming.md | 15 ++ tutorials/1_open_source_software.md | 41 ++++++ .../2_01_introduction_to_numerical_methods.md | 0 tutorials/2_ai_assisted_programming.md | 5 + tutorials/Classes_and_Objects.md | 8 -- tutorials/Functions.md | 29 ---- tutorials/arrays.md | 35 ----- tutorials/basics_of_python.md | 155 --------------------- tutorials/computing_fundamentals.md | 15 -- tutorials/control_structures.md | 5 - tutorials/fundamentals_of_programming.md | 15 -- tutorials/installing_anaconda.md | 57 -------- tutorials/intro_to_anaconda.md | 60 -------- tutorials/open_source_software.md | 4 - tutorials/readme.md | 21 +-- tutorials/spyder_getting_started.md | 10 -- 26 files changed, 479 insertions(+), 403 deletions(-) create mode 100644 tutorials/1_01_intro_to_programming.md create mode 100644 tutorials/1_02_installing_anaconda.md create mode 100644 tutorials/1_03_intro_to_anaconda.md create mode 100644 tutorials/1_04_spyder_getting_started.md create mode 100644 tutorials/1_05_basics_of_python.md create mode 100644 tutorials/1_06_arrays.md create mode 100644 tutorials/1_07_control_structures.md create mode 100644 tutorials/1_classes_and_objects.md create mode 100644 tutorials/1_computing_fundamentals.md create mode 100644 tutorials/1_functions.md create mode 100644 tutorials/1_fundamentals_of_programming.md create mode 100644 tutorials/1_open_source_software.md create mode 100644 tutorials/2_01_introduction_to_numerical_methods.md create mode 100644 tutorials/2_ai_assisted_programming.md delete mode 100644 tutorials/Classes_and_Objects.md delete mode 100644 tutorials/Functions.md delete mode 100644 tutorials/arrays.md delete mode 100644 tutorials/basics_of_python.md delete mode 100644 tutorials/computing_fundamentals.md delete mode 100644 tutorials/control_structures.md delete mode 100644 tutorials/fundamentals_of_programming.md delete mode 100644 tutorials/installing_anaconda.md delete mode 100644 tutorials/intro_to_anaconda.md delete mode 100644 tutorials/open_source_software.md delete mode 100644 tutorials/spyder_getting_started.md diff --git a/tutorials/1_01_intro_to_programming.md b/tutorials/1_01_intro_to_programming.md new file mode 100644 index 0000000..8cebd0e --- /dev/null +++ b/tutorials/1_01_intro_to_programming.md @@ -0,0 +1,15 @@ +# Introduction to Programming +## The Importance of Programming in Engineering + +Engineering is all about solving problems, designing innovative solutions, and making systems work efficiently. Whether you’re designing cars, airplanes, rockets, or even everyday machines, programming plays a critical role in modern engineering. + +In mechanical engineering, programming helps us **analyze data, model complex systems, automate repetitive tasks, and simulate real-world physics.** For example, instead of spending hours solving equations by hand, engineers can write a program that does it in seconds. This saves time and therefore do more. + +With programming, mechanical engineers can: + +- **Automate calculations:** Quickly solve equations for heat transfer, fluid dynamics, and mechanical stresses. +- **Simulate systems:** Model how a bridge bends under weight or how an engine burns fuel efficiently. +- **Analyze data:** Process thousands of test results to improve designs. +- **Control machines:** Program robots, 3D printers, and CNC's. + +Today, learning to program is just as important as learning how to use a wrench or a CAD (Computer-Aided Design) tool. In this course, you’ll see how computing and programming apply to mechanical engineering and how they can make you a better problem solver. By the end, you’ll have the skills to write simple programs that help you **think like an engineer in the digital age.** \ No newline at end of file diff --git a/tutorials/1_02_installing_anaconda.md b/tutorials/1_02_installing_anaconda.md new file mode 100644 index 0000000..2e227b7 --- /dev/null +++ b/tutorials/1_02_installing_anaconda.md @@ -0,0 +1,56 @@ +# Installing Anaconda + +This tutorial will cover the steps on how to install Anaconda. + +*Note for Advanced users: For those who wish to have a lightweight installation, can install miniconda or miniForge, however for this course we will show you how to use Anaconda Navigator. If you've never used the programs before then using Anaconda is recommended.* + +### What is Anaconda? +From the Anaconda website + Anaconda is an open source data science and artificial intelligence distribution platform for Python and R programing language. -Wikipedia + +### What is Navigator? +Anaconda Navigator is a desktop graphical user interface (GUI) included in Anaconda distribution that allows users to launch application and manage Conda Packages, environments and channels without using a command-line interface (CLI). -Wikipedia + +## Instructions +1. Find the latest version of Navigator from the official Anaconda Inc. website: [Download Anaconda](https://www.anaconda.com/download) + +2. Press the *Download Now* button. + +3. Press the *Skip registration* button below the submit button, otherwise submit your email address to subscribe to the Anaconda email list. + +4. Under Anaconda Installers press *Download* or find the appropriate version for your operating system below. + +Proceed to next section for your respective operating system. + +### Windows +Depending on what browser you use, it should look something like this: +![Downloading](figures/installingAnaconda_windows_downloading.png) + +Once the download is complete, double click the executible (.exe) file to start the installer. Proceed with the installation instructions. + +![Welcome screen](figures/installingAnaconda_windows_installer_01_welcome.png) + +![Terms and conditions](figures/installingAnaconda_windows_installer_02_terms.png) + +Depending on whether you wish to install Anaconda on +![Install for](figures/installingAnaconda_windows_installer_03_for.png) + +![Installation destination](figures/installingAnaconda_windows_installer_04_destination.png) + +**Advanced installation options** It is recommended to register Anaconda3 as the default python version if you already have an instance of python installed. Otherwise, you can leave the checkboxes as defaults. +![Avanced Options](figures/installingAnaconda_windows_installer_05_advanced.png) + +![Installing](figures/installingAnaconda_windows_installer_06_installing.png) + +![Installing 2](figures/installingAnaconda_windows_installer_07_installing2.png) + +![Complete](figures/installingAnaconda_windows_installer_08_installing_complete.png) + +![Cloud](figures/installingAnaconda_windows_installer_09_cloud.png) + +![Finish](figures/installingAnaconda_windows_installer_10_finish.png) + +You made it! Anaconda is now installed. Assuming that you didn't add Anaconda to PATH environment variable you will need to start navigator from the start menu. + +### Mac/Linux +Anaconda provides installation documentation for Mac and Linux users, please refer to the [documentation page](https://docs.anaconda.com/anaconda/install/). diff --git a/tutorials/1_03_intro_to_anaconda.md b/tutorials/1_03_intro_to_anaconda.md new file mode 100644 index 0000000..841dfdd --- /dev/null +++ b/tutorials/1_03_intro_to_anaconda.md @@ -0,0 +1,60 @@ +# Introduction to Anaconda Navigator + +Anaconda Navigator is a program that we will be using in this course to manage Python environments, libraries and launch programs to help us write our python code. + +The Anaconda website nicely describes *Navigator* as: +
+

a graphical user interface (GUI) that enables you to work with packages and environments without needing to type conda commands in a terminal window.Find the packages you want, install them in an environment, run the packages, and update them – all inside Navigator. +

+ + +Note to windows 10 users: Some installation instances do not allow users to search the start menu for *Navigator*, instead, you'll have to find the program under the *Anaconda (anaconda3)* folder. Expand the folder and click on *Anaconda Navigator* to launch the program. + +![Anaconda Navigator screen](figures/installingAnaconda_windows_launched.png) + +Once Navigator starts, under *Home*, you'll see tiles of programs that come with anaconda. The tab allows you to launch the programs we will be using in this course. Before jumping straight into the programs we will first need to configure our Python instance. + +The *Environment* page allows us to install a variety of libraries and configure our environments for different project, more on this in the next section. + +## Environments +A Python environment can be thought of as a "container" where you can have all the tools, libraries, and dependencies your Python project needs without interfering with other projects. Think of it as a toolbox dedicated to a specific task. + +Although the base environment comes with many libraries and programs pre-installed, it's recommended to create a dedicated environment for your projects. This protects the base environment from breaking due to complex dependency conflicts. Let us go ahead and create a new environment for us to use Spyder with. + +1. Click on the *Environments* page located on the left hand side. + +![Environment page](https://docs.anaconda.com/_images/nav-env-labeled1.png) + +2. At the bottom of the environments list, click *Create*. + +![Create new environment](https://docs.anaconda.com/_images/nav-env-create1.png) + +3. Select the python checkbox. + +4. Select versions of python. At the time of making this tutorial the latest version of Python is 3.xx.x. We will go ahead and use that one. + +5. Choose an appropriate name for your project. We will be creating an environment for the Spyder IDE so we'll call it "spyder-dev". + +6. Click *Create*. + +For more information see [Anaconda Environments](https://docs.anaconda.com/working-with-conda/environments/) and [Managing environment](https://docs.anaconda.com/navigator/tutorials/manage-environments/). + +## Package Management +Now that we have a clean environment configured, let us install some library we will be using for this class. + +1. Navigate to the environment page and select the environment we just created in the previous section. + +![Select environment to manage](https://docs.anaconda.com/_images/nav-pkg-list1.png) + +2. Use the search bar in the top right corner to search for the following packages: + +| Library | Usage | +| ---------- | --------------------------------- | +| numpy | Numerical computation | +| scipy | Scientific and techical computing | +| pandas | Data manipulation and analysis | +| matplotlib | Plots and visualizations | +| sympy | Symbolic mathematics | +*Note: The libraries list may change as the course develops* + +1. Once the diff --git a/tutorials/1_04_spyder_getting_started.md b/tutorials/1_04_spyder_getting_started.md new file mode 100644 index 0000000..03b7fd3 --- /dev/null +++ b/tutorials/1_04_spyder_getting_started.md @@ -0,0 +1,27 @@ +# Getting started with Spyder + +In this tutorial we will cover the basics of the Spyder IDE (Interactive Development Environment). If you've ever worked with MATLAB before, then this will feel familiar. Spyder is a program + + +## Launching Spyder +Using Anaconda we will select the environment we created earlier *spyder-dev*. + + +## Spyder Interface + +![Spyder Interface](image) + +Once you open up Spyder in it's default configuration, you'll see three sections; the editor IPython Console, Help viewer. You can customize the interface to suit your prefference and needs some of which include, rearrange, undock, hide panes. Feel free to set up Spyder as you like. + +### Editor +This pane is used to write and save scripts. + + +### IPython Console +This pane allows you to run commands, functions, do math computations and assign variables. + +### Variable Explorer +This pane shows all the variables stored once you've + +### Help Viewer + diff --git a/tutorials/1_05_basics_of_python.md b/tutorials/1_05_basics_of_python.md new file mode 100644 index 0000000..cb74910 --- /dev/null +++ b/tutorials/1_05_basics_of_python.md @@ -0,0 +1,141 @@ +# Basics of Python + +This page contains important fundamental concepts used in Python such as syntax, operators, order or precedence and more. + +## Syntax +### Indentations +In python *indentations* or the space at the start of each line, signifies a block of code. This becomes important when we start working with function and loops. +### Comments +Comments can be added to your code using the hash operator (#). Any text behind the comment operator till the end of the line will be rendered as a comment. +If you have an entire block of text or code that needs to be commented out, the triple quotation marks (""") can be used. Once used all the code after it will be considered a comment until the comment is ended with the triple quotation marks. +## Operators +### Arithmetic operators +| Operator | Name | +| --- | --- | +| + | Addition | +| - | Subtraction | +| * | Multiplication | +| / | Division | +| % | Modulus | +| ** | Exponentiation | +| // | Floor division | + + +### Comparison operators +| Operator | Name | +| --- | --- | +| == | Equal | +| != | Not equal | +| > | Greater than | +| < | Less than | +| >= | Greater than or equal to | +| <= | Less than or equal to | + +### Logical operators +| Operator | Descrription | +| --- | --- | +| and | Returns True if both statemetns are true | +| or | Returns True if one of the statements is true | +| not | Reerse the result, returns False if the result is true | + +### Identity operators +| Operator | Description | +| --- | --- | +| is | Returns True if both variables are the same object | +| is not | Returns True if both variables are not the same object | + +## Order of Operation +| Operator | Description | +| --- | --- | +| () | Parentheses | +| ** | Exponentiation | +| * / // % | Multiplication, Division, floor division, and modulus | +| & | AND | +| ^ | XOR | +| \| | OR | +| == | Comparision, identity and membership operators | +| not | logical NOT | +| and | AND | +| or | OR | + + +## Data types +Data types are different ways a computer stores data. Other data types use fewer bits than others allowing you to better utilize your computer memory. This is important for engineers because +The most common data types that an engineer encounters in python are numeric types. +- 'int' - integer +- 'float' - a decimal number +- 'complex' - imaginary number + +The comprehensive table below show all built-in data types available in python. + +| Category | Data Type | +| -------- | ---------------------------- | +| Text | int, float, complex | +| Sequance | list, tuple, range | +| Mapping | dict | +| Set | set, frozenset | +| Boolean | bytes, bytearray, memoryview | +| Binary | bytes, bytearray, memoryview | +| None | NoneType | + +## Variables + +A **variable** in Python is a name that stores a value, allowing you to use and manipulate data efficiently. + +#### Declaring and Assigning Variables + +In Python, you don’t need to declare the type of a variable. Just assign a value using `=`. + +```python +x = 10 # Integer +y = 3.14 # Float +name = "Joe" # String +is_valid = True # Boolean +``` + +You can assign multiple variables at once: + +```python +a, b, c = 1, 2, 3 +``` + +Similarly we can assign the same value to multiple variables: + +```python +x = y = z = 100 +``` +##### Rules + +- Must start with a letter or `_` +- Cannot start with a number +- Can only contain letters, numbers, and `_` +- Case-sensitive (`Name` and `name` are different) + +#### Updating Variables + +You can change a variable’s value at any time. + +```python +x = 5 +x = x + 10 # Now x is 15 +``` + +Or shorthand: + +```python +x += 10 # Same as x = x + 10 +``` + +#### Variable Types & Type Checking + +Use `type()` to check a variable’s type. + +```python +x = 10 +print(type(x)) # Output: + +y = "Hello" +print(type(y)) # Output: +``` + + diff --git a/tutorials/1_06_arrays.md b/tutorials/1_06_arrays.md new file mode 100644 index 0000000..b16e7fc --- /dev/null +++ b/tutorials/1_06_arrays.md @@ -0,0 +1,46 @@ +# Arrays + +In computer programming, an array is a structure for storing and retrieving data. We often talk about an array as if it were a grid in space, with each cell storing one element of the data. For instance, if each element of the data were a number, we might visualize a “one-dimensional” array like a list: + +| 1 | 5 | 2 | 0 | + +A two-dimensional array would be like a table: + +| 1 | 5 | 2 | 0 | +| 8 | 3 | 6 | 1 | +| 1 | 7 | 2 | 9 | + + +A three-dimensional array would be like a set of tables, perhaps stacked as though they were printed on separate pages. + +- From [Numpy documentation](https://numpy.org/doc/2.2/user/absolute_beginners.html) + +--- + +In this tutorial we will be introducing arrays and we will be using the numpy library. Arrays, lists, vectors, matrices, sets - You might've heard of them before, they all store data. In programming, an array is a variable that can hold more than one value at a time. We will be using the Numpy python library to create arrays. + +Since we already have installed Numpy previously, we can start using the package. + +## Import Numpy +When using packages in python, we need to let it know what package we will be using. This is called importing. To import numpy we need to declare it a the start of a script as follows: +```python +import numpy as np +``` + import calls for a library to use, in our case it is Numpy. + as gives the library an alias in your script. It's common convention in Python programming to make the code shorter and more readable. We will be using *np* as it's a standard using in many projects. + +# Creating arrays +Now that we have imported the library we can create a one dimensional array or *vector* +```python +x = np.array([1,2,3]) +``` + + +To create a *matrix* we can nest the arrays to create a two dimensional array. + +```python +matrix = np.array([[1,2,3],[4,5,6],[7,8,9]]) +``` + +*Note: for every array we nest, we get a new dimension in our data structure.* + diff --git a/tutorials/1_07_control_structures.md b/tutorials/1_07_control_structures.md new file mode 100644 index 0000000..245ef5a --- /dev/null +++ b/tutorials/1_07_control_structures.md @@ -0,0 +1,10 @@ +# Control Structures +Control structures allow us to control the flow of execution in a Python program. The two main types are **conditional statements (`if` statements)** and **loops (`for` and `while` loops)**. + +## Conditional statements +Conditional statements let you execute code based on different conditions using if, elif and else statements. + + + + +## Loops diff --git a/tutorials/1_classes_and_objects.md b/tutorials/1_classes_and_objects.md new file mode 100644 index 0000000..0392483 --- /dev/null +++ b/tutorials/1_classes_and_objects.md @@ -0,0 +1,8 @@ +# Modular Programming + +Classes and Objects + +## What are they? + + +## Why do we care? diff --git a/tutorials/1_computing_fundamentals.md b/tutorials/1_computing_fundamentals.md new file mode 100644 index 0000000..1fef338 --- /dev/null +++ b/tutorials/1_computing_fundamentals.md @@ -0,0 +1,15 @@ +# Computing Fundamentals + +## Using computers as a tool for engineers + +## How do computers work? +Globe analogy: Hardware, Kernel, Shell, Application, Software. + +## Interfaces + +### Text editor for Scripting + + + +### Command window +Command window, terminal, console, command prompt you might've heard of theses terms before. They all essentially mean the same thing. The command window is used to control your system. diff --git a/tutorials/1_functions.md b/tutorials/1_functions.md new file mode 100644 index 0000000..e4c9874 --- /dev/null +++ b/tutorials/1_functions.md @@ -0,0 +1,29 @@ +# Functions + +Like a traditional mathematical functions, python functions can take an input, process it, and give an output. Functions are blocks of code that is run everytime it's called. This allows us to re-use code. + +Functions are defined by using the def keyword. Reminder: it is important to indent all code inside the function to signify the end of the function. + +## Creating a function with no input +This is useful if you need to re-use code without having to copy paste the block. + +``` + def function_name(): + print("This is from a function") +``` + +## Creating a function with one input + +``` + def function(x): + print(x + " is best") +``` + +## Returning values from a function +Let's make a + +``` + def function(x, b): + y = 3*x+b + return y +``` diff --git a/tutorials/1_fundamentals_of_programming.md b/tutorials/1_fundamentals_of_programming.md new file mode 100644 index 0000000..617d2c3 --- /dev/null +++ b/tutorials/1_fundamentals_of_programming.md @@ -0,0 +1,15 @@ +# Fundamentals of programming +## Orientation of common interfaces +In this section we will cover the use and purpose of some common interfaces that you'll be using in this course. + +### Command window, terminal, console, command prompt. +This is a text based interface that allows the users to interact with the computer. It is used to execute commands, run scripts or programs. + + +### Text Editor / Script +Your text editor is the program used to write a script which can be re-run every time you call it from the command window. This can be a built-in text editor such as Spyder and MATLAB provide or an external on such a notepad++. + + + + Globe analogy: Hardware, Kernel, shell, Application software. + - Scripting \ No newline at end of file diff --git a/tutorials/1_open_source_software.md b/tutorials/1_open_source_software.md new file mode 100644 index 0000000..924878b --- /dev/null +++ b/tutorials/1_open_source_software.md @@ -0,0 +1,41 @@ +# Open Source Software + +Open-source software (OSS) is a type of software that allows users to access, modify, and distribute its source code freely. It is built on principles of collaboration, transparency, and community-driven development. + +### Key Principles of Open Source Software + +- **Free Distribution:** Anyone can download and use the software without cost. +- **Access to Source Code:** Users can view and modify the code to suit their needs. +- **Community Collaboration:** Developers from around the world contribute to improvements and security fixes. + +### Benefits of Open Source Software + +- **Cost-effectiveness:** Open-source software is free to use, making it accessible to individuals and organizations. +- **Transparency and Security:** Open code allows for peer review, reducing security vulnerabilities. +- **Community Support:** Global developer communities provide assistance, troubleshooting, and improvements. +- **Customization and Flexibility:** Users can modify software to fit their specific requirements. + +### Challenges of Open Source Software + +- **Usability Issues:** Some open-source software may have a steeper learning curve. +- **Compatibility Problems:** Integration with proprietary systems may require additional effort. +- **Support and Documentation:** The quality of documentation and support varies. +- **Sustainability:** Open-source projects often rely on volunteers, which can lead to inconsistent updates. + +### Popular Open Source Projects + +- **Operating Systems:** Linux, Ubuntu +- **Web Browsers:** Mozilla Firefox +- **Programming Languages:** Python, JavaScript +- **Office Suites:** LibreOffice +- **Multimedia Tools:** Audacity, Blender +- **Software Development:** Git, GitHub, Apache + +### How to Contribute to Open Source + +- **Finding Projects:** Platforms like GitHub, GitLab, and SourceForge host many open-source projects. +- **Understanding Licensing:** Common licenses include GPL, MIT, and Apache. +- **Ways to Contribute:** Developers can contribute code, test software, write documentation, translate, or help with design. +- **Best Practices for Contributions:** Using version control (Git), writing clean code, and following community guidelines are essential for successful collaboration. + +## Licensing diff --git a/tutorials/2_01_introduction_to_numerical_methods.md b/tutorials/2_01_introduction_to_numerical_methods.md new file mode 100644 index 0000000..e69de29 diff --git a/tutorials/2_ai_assisted_programming.md b/tutorials/2_ai_assisted_programming.md new file mode 100644 index 0000000..e2b39a0 --- /dev/null +++ b/tutorials/2_ai_assisted_programming.md @@ -0,0 +1,5 @@ +AI assisted programming + +- GitHub Copilot +- ChatGPT +- AIXcoder diff --git a/tutorials/Classes_and_Objects.md b/tutorials/Classes_and_Objects.md deleted file mode 100644 index 0392483..0000000 --- a/tutorials/Classes_and_Objects.md +++ /dev/null @@ -1,8 +0,0 @@ -# Modular Programming - -Classes and Objects - -## What are they? - - -## Why do we care? diff --git a/tutorials/Functions.md b/tutorials/Functions.md deleted file mode 100644 index e4c9874..0000000 --- a/tutorials/Functions.md +++ /dev/null @@ -1,29 +0,0 @@ -# Functions - -Like a traditional mathematical functions, python functions can take an input, process it, and give an output. Functions are blocks of code that is run everytime it's called. This allows us to re-use code. - -Functions are defined by using the def keyword. Reminder: it is important to indent all code inside the function to signify the end of the function. - -## Creating a function with no input -This is useful if you need to re-use code without having to copy paste the block. - -``` - def function_name(): - print("This is from a function") -``` - -## Creating a function with one input - -``` - def function(x): - print(x + " is best") -``` - -## Returning values from a function -Let's make a - -``` - def function(x, b): - y = 3*x+b - return y -``` diff --git a/tutorials/arrays.md b/tutorials/arrays.md deleted file mode 100644 index e698d67..0000000 --- a/tutorials/arrays.md +++ /dev/null @@ -1,35 +0,0 @@ -# Arrays - -In computer programming, an array is a structure for storing and retrieving data. We often talk about an array as if it were a grid in space, with each cell storing one element of the data. For instance, if each element of the data were a number, we might visualize a “one-dimensional” array like a list: - -| 1 | 5 | 2 | 0 | - -A two-dimensional array would be like a table: - -| 1 | 5 | 2 | 0 | -| 8 | 3 | 6 | 1 | -| 1 | 7 | 2 | 9 | - -A three-dimensional array would be like a set of tables, perhaps stacked as though they were printed on separate pages. - -- From [Numpy documentation](https://numpy.org/doc/2.2/user/absolute_beginners.html) - ---- - -In this tutorial we will be introducing arrays and we will be using the numpy library. Arrays, lists, vectors, matrices, sets - You might've heard of them before, they all store data. In programming, an array is a variable that can hold more than one value at a time. We will be using the Numpy python library to create arrays. - -Since we already have installed Numpy previously, we can start using the package. - -## Import Numpy -When using packages in python, we need to let it know what package we will be using. This is called importing. To import numpy we need to declare it a the start of a script as follows: -``` -import numpy as np -``` - import calls for a library to use, in our case it is Numpy. - as gives the library an alias in your script. It's common convention in Python programming to make the code shorter and more readable. We will be using *np* as it's a standard using in many projects. - -# Creating arrays -Now that the script has been -``` - -``` diff --git a/tutorials/basics_of_python.md b/tutorials/basics_of_python.md deleted file mode 100644 index 5c12ff4..0000000 --- a/tutorials/basics_of_python.md +++ /dev/null @@ -1,155 +0,0 @@ -# Basics of Python - -This page contains important fundamental concepts used in Python such as syntax, operators, order or precedence and more. - -## Syntax -### Indentations -In python *indentations* or the space at the start of each line, signifies a block of code. This becomes important when we start working with function and loops. -### Comments -Comments can be added to your code using the hash operator (#). Any text behind the comment operator till the end of the line will be rendered as a comment. -If you have an entire block of text or code that needs to be commented out, the triple quotation marks (""") can be used. Once used all the code after it will be considered a comment until the comment is ended with the triple quotation marks. -## Operators -### Arithmetic operators -| Operator | Name | -| --- | --- | -| + | Addition | -| - | Subtraction | -| * | Multiplication | -| / | Division | -| % | Modulus | -| ** | Exponentiation | -| // | Floor division | - - -### Comparison operators -| Operator | Name | -| --- | --- | -| == | Equal | -| != | Not equal | -| > | Greater than | -| < | Less than | -| >= | Greater than or equal to | -| <= | Less than or equal to | - -### Logical operators -| Operator | Descrription | -| --- | --- | -| and | Returns True if both statemetns are true | -| or | Returns True if one of the statements is true | -| not | Reerse the result, returns False if the result is true | - -### Identity operators -| Operator | Description | -| --- | --- | -| is | Returns True if both variables are the same object | -| is not | Returns True if both variables are not the same object | - -## Order of Operation -| Operator | Description | -| --- | --- | -| () | Parentheses | -| ** | Exponentiation | -| * / // % | Multiplication, Division, floor division, and modulus | -| & | AND | -| ^ | XOR | -| \| | OR | -| == | Comparision, identity and membership operators | -| not | logical NOT | -| and | AND | -| or | OR | - - -## Data types -Data types are different ways a computer stores data. Other data types use fewer bits than others allowing you to better utilize your computer memory. This is important for engineers because -The most common data types that an engineer encounters in python are numeric types. -- 'int' - integer -- 'float' - a decimal number -- 'complex' - imaginary number - - -The comprehensive table below show all built-in data types available in python. - - - -| Category | Data Type | -| ---------- | ------------------------- | -| Text | int, float, complex | -| Sequance | list, tuple, range | -| Mapping | dict | -| Set | set, frozenset | -| Boolean | bytes, bytearray, memoryview | -| Binary | bytes, bytearray, memoryview | -| None | NoneType | - -## Variables - -A **variable** in Python is a name that stores a value, allowing you to use and manipulate data efficiently. - -#### 1. Declaring and Assigning Variables - -In Python, you don’t need to declare the type of a variable. Just assign a value using `=`. - -```python -x = 10 # Integer -y = 3.14 # Float -name = "Joe" # String -is_valid = True # Boolean -``` - -#### Rules - -- Must start with a letter or `_` -- Cannot start with a number -- Can only contain letters, numbers, and `_` -- Case-sensitive (`Name` and `name` are different) - -#### **4. Updating Variables** - -You can change a variable’s value at any time. - -```python -x = 5 -x = x + 10 # Now x is 15 -``` - -Or shorthand: - -```python -x += 10 # Same as x = x + 10 -``` - -#### **5. Multiple Assignments** - -You can assign multiple variables at once: - -```python -a, b, c = 1, 2, 3 -``` - -Similarly we can assign the same value to multiple variables: - -```python -x = y = z = 100 -``` - -#### **6. Variable Types & Type Checking** - -Use `type()` to check a variable’s type. - -```python -x = 10 -print(type(x)) # Output: - -y = "Hello" -print(type(y)) # Output: -``` - - -#### 8. Deleting Variables - -Use `del` to remove a variable: - -```python -x = 10 -del x -``` diff --git a/tutorials/computing_fundamentals.md b/tutorials/computing_fundamentals.md deleted file mode 100644 index 1fef338..0000000 --- a/tutorials/computing_fundamentals.md +++ /dev/null @@ -1,15 +0,0 @@ -# Computing Fundamentals - -## Using computers as a tool for engineers - -## How do computers work? -Globe analogy: Hardware, Kernel, Shell, Application, Software. - -## Interfaces - -### Text editor for Scripting - - - -### Command window -Command window, terminal, console, command prompt you might've heard of theses terms before. They all essentially mean the same thing. The command window is used to control your system. diff --git a/tutorials/control_structures.md b/tutorials/control_structures.md deleted file mode 100644 index 345d94a..0000000 --- a/tutorials/control_structures.md +++ /dev/null @@ -1,5 +0,0 @@ -# Control Structers - -## If statements - -## Loops diff --git a/tutorials/fundamentals_of_programming.md b/tutorials/fundamentals_of_programming.md deleted file mode 100644 index 617d2c3..0000000 --- a/tutorials/fundamentals_of_programming.md +++ /dev/null @@ -1,15 +0,0 @@ -# Fundamentals of programming -## Orientation of common interfaces -In this section we will cover the use and purpose of some common interfaces that you'll be using in this course. - -### Command window, terminal, console, command prompt. -This is a text based interface that allows the users to interact with the computer. It is used to execute commands, run scripts or programs. - - -### Text Editor / Script -Your text editor is the program used to write a script which can be re-run every time you call it from the command window. This can be a built-in text editor such as Spyder and MATLAB provide or an external on such a notepad++. - - - - Globe analogy: Hardware, Kernel, shell, Application software. - - Scripting \ No newline at end of file diff --git a/tutorials/installing_anaconda.md b/tutorials/installing_anaconda.md deleted file mode 100644 index 5a2e63e..0000000 --- a/tutorials/installing_anaconda.md +++ /dev/null @@ -1,57 +0,0 @@ -# Installing Anaconda Navigator - -This tutorial walk will walk through how to install Anaconda Navigator. - -### What is Anaconda? - Anaconda is an open source data science and artificial intelligence distribution platform for Python and R programing language. -Wikipedia - -### What is Navigator? -Anaconda Navigator is a desktop graphical user interface (GUI) inluded in Anaconda distribution that allows users to launch application and manage Conda Packages, environments and channels without using a command-line interface (CLI). -Wikipedia - -## Instructions -1. Find the latest version of Navigator from the official Anaconda Inc. website: https://www.anaconda.com/products/navigator https://www.anaconda.com/download - -2. Press the *Download Now* button. - -3. Press the *Skip registration* button or submit your email address to subscribe to the Anaconda email list. - -4. Under Anaconda Installers press *Download* or find the appropriate version for your operating system below. - -Proceed to next section for your respective operating system. - -### Windows - -![Downloading](figures/installingAnaconda_windows_downloading.png) - -![Save to file](figures/installingAnaconda_windows_save.png) - -Once the download is complete, double click the executible (.exe) file to start the installer. Proceed with the installation instructions, you should be able to leave most option in default settings. - -![Welcome screen](figures/installingAnaconda_windows_installer_01_welcome.png) - -![Terms and conditions](figures/installingAnaconda_windows_installer_02_terms.png) - -![Install for](figures/installingAnaconda_windows_installer_03_for.png) - -![Installation destination](figures/installingAnaconda_windows_installer_04_destination.png) - -**Advanced installation options** It is recommended to register Anaconda3 as the default python version if you already have an instance of python installed. Otherwise, you can leave the checkboxes as defaults. -![Avanced Options](figures/installingAnaconda_windows_installer_05_advanced.png) - -![Installing](figures/installingAnaconda_windows_installer_06_installing.png) - -![Installing 2](figures/installingAnaconda_windows_installer_07_installing2.png) - -![Complete](figures/installingAnaconda_windows_installer_08_installing_complete.png) - -![Cloud](figures/installingAnaconda_windows_installer_09_cloud.png) - -![Finish](figures/installingAnaconda_windows_installer_10_finish.png) - -Note: If you did not select start navigator after installation, you will need to go to you start menu and start Navigator from Applications list. - -### Mac -For Mac user - -### Linux -Refer to your distribution's documentation on how to install Anaconda. For a ligt-weight installation. Miniconda and Spyder diff --git a/tutorials/intro_to_anaconda.md b/tutorials/intro_to_anaconda.md deleted file mode 100644 index f05cb4c..0000000 --- a/tutorials/intro_to_anaconda.md +++ /dev/null @@ -1,60 +0,0 @@ -# Introduction to Anaconda Navigator - -Anaconda Navigator is a program that we will be using in this course to manage Python environments, libraries and launch programs to help us write our python code. - -The Anaconda website nicely describes *Navigator* as: -
-

a graphical user interface (GUI) that enables you to work with packages and environments without needing to type conda commands in a terminal window.Find the packages you want, install them in an environment, run the packages, and update them – all inside Navigator. -

- - -Note to windows 10 users: Some installation instances do not allow users to search the start menu for *Navigator*, instead, you'll have to find the program under the *Anaconda (anaconda3)* folder. Expand the folder and click on *Anaconda Navigator* to launch the program. - -![Anaconda Navigator screen](figures/installingAnaconda_windows_launched.png) - -Once Navigator starts, under *Home*, you'll see tiles of programs that come with anaconda. The tab allows you to launch the programs we will be using in this course. Before jumping straight into the programs we will first need to configure our Python instance. - -The *Environment* page allows us to install a variety of libraries and configure our environments for different project, more on this in the next section. - -## Environments -A Python environment can be thought of as a "container" where you can have all the tools, libraries, and dependencies your Python project needs without interfering with other projects. Think of it as a toolbox dedicated to a specific task. - -Although the base environment comes with many libraries and programs pre-installed, it's recommended to create a dedicated environment for your projects. This protects the base environment from breaking due to complex dependency conflicts. Let us go ahead and create a new environment for us to use Spyder with. - -1. Click on the *Environments* page located on the left hand side. - -![Environment page](https://docs.anaconda.com/_images/nav-env-labeled1.png) - -2. At the bottom of the environments list, click *Create*. - -![Create new environment](https://docs.anaconda.com/_images/nav-env-create1.png) - -3. Select the python checkbox. - -4. Select versions of python. At the time of making this tutorial the latest version of Python is 3.xx.x. We will go ahead and use that one. - -5. Choose an appropriate name for your project. We will be creating an environment for the Spyder IDE so we'll call it "spyder-dev". - -6. Click *Create*. - -For more information see [Anaconda Environments](https://docs.anaconda.com/working-with-conda/environments/) and [Managing environment](https://docs.anaconda.com/navigator/tutorials/manage-environments/). - -## Package Management -Now that we have a clean environment configured, let us install some library we will be using for this class. - -1. Navigate to the environment page and select the environment we just created in the previous section. - -![Select environment to manage](https://docs.anaconda.com/_images/nav-pkg-list1.png) - -2. Use the search bar in the top right corner to search for the following packages: - -| Library | Usage | -| ---------- | ---------------------------------------------------- | -| numpy | Numerical computation | -| scipy | Scientific and techical computing | -| pandas | Data manipulation and analysis | -| matplotlib | Plots and visualizations | -| sympy | Symbolic mathematics | -| cython | Optimizing Python code and interfacing with C++ code | - -3. Once the diff --git a/tutorials/open_source_software.md b/tutorials/open_source_software.md deleted file mode 100644 index 0a10f27..0000000 --- a/tutorials/open_source_software.md +++ /dev/null @@ -1,4 +0,0 @@ -# Open Source Software - - -## Licensing diff --git a/tutorials/readme.md b/tutorials/readme.md index 283c1ad..fcc2283 100644 --- a/tutorials/readme.md +++ b/tutorials/readme.md @@ -3,16 +3,17 @@ This directory contains all the tutorials. ## Table of Content ### Introductory Programming Concepts -- [Installing Anaconda](installing_anaconda.md) -- [Intro to Anaconda](intro_to_anaconda.md) -- [Getting started with Spyder](spyder_getting_started.md) -- [Fundamentals of Computing](fundamentals_of_programming.md) -- [Open source_software](open_source_software.md) -- [Basics of python](basics_of_python.md) -- [Arrays](arrays.md) -- [Control Structures](control_structures.md) -- [Functions](Functions.md) -- [Classes/Objects](Classes_and_Objects.md) +- [Introduction to Programming](1_01_intro_to_programming) +- [Installing Anaconda](1_02_installing_anaconda.md) +- [Intro to Anaconda](1_03_intro_to_anaconda.md) +- [Getting started with Spyder](1_04_spyder_getting_started.md) +- [Fundamentals of Computing](1_fundamentals_of_programming.md) +- [Open source_software](1_open_source_software.md) +- [Basics of python](1_05_basics_of_python.md) +- [Arrays](1_06_arrays.md) +- [Control Structures](1_07_control_structures.md) +- [Functions](1_functions.md) +- [Classes/Objects](1_classes_and_objects.md) ### Algorithm Developments for ME - [Version Control](version_control.md) diff --git a/tutorials/spyder_getting_started.md b/tutorials/spyder_getting_started.md deleted file mode 100644 index 8a7f566..0000000 --- a/tutorials/spyder_getting_started.md +++ /dev/null @@ -1,10 +0,0 @@ -# Getting started with Spyder - -In this tutorial we will cover the basics of the Spyder IDE (Interactive Development Environment). If you've ever worked with MATLAB before, then this will feel familiar. Spyder is a program - - -## Launching Spyder -Using Anaconda we will select the environment we created earlier. - - -## Spyder Interface -- cgit v1.2.3