Repository navigation
Releases
A14 - Docker
Let's create a dockerfile that will allow us to run python
Step 1. Build the Dockerfile
Start with a base image
FROM python:3.8-slim
Set working directory
WORKDIR /app
Copy app files to the container
COPY . /app
Install dependencies
RUN pip install -r requirements.txt
Run the app
CMD ["python", "app.py"]
-
Build the image
docker build -t my-python-app . -
Run the image
docker run my-python-app
This assignment will be due Dec 6 before finals. I will add the submission requirement to the assignment at a later date.
Assignment A12
Using the Crime dataset we will work on writing unit testing and packaging the unit tests into a module that can be published. (See Lec19)
Instruction:
Part 1: Write modules and unit test
Create two separate modules in python
validate_functions.py - Write a script that checks that the 'Vict sex' column is either M or F and not missing (NULL). Additonally, check the column 'Vict age' that the values are between 1-100 and not missing (NULL)
stats_function.py - Write a script that iterates the age column and calculates the mean and median age.
Write a unit test that takes in your python scripts as libraries and perform unit tests on them. For the modules:
For the stats_function module, test if your script returns a valid value. Consider an edge case and write a unit test for it.
For the validate_functions module, test if the value is the wrong datatype
Freeze your environment to build a requirement.txt
Package all the script into a directory called 'crime_test'.
Part 2: Build your package
In addition to your directory, include the additional files needed to build a package; init.py and setup.py
For setup.py include your package information (name and version) and dependencies.
For init.py, include the metadata of your version of this library
Build your package
Part 3: Publish your package on GitHub
Once your package is built, send your library to another classmate and have them test it out to see if they can download, install and run it.
Install your classmate package and report issues to your classmate
Write a summary, as text input in your submission, on your classmates feedback and what feedback you had for your classmate
Submitting A15
Create a simple nextflow pipeline where we take in an input string "Hello World" and convert it to all caps "HELLO WORLD"
Submission
-
Create a nextflow.config file with your parameters
-
Create a allcaps.nf pipeline
-
Upload both files into directory 'A15_nextflow' into your Github repo
-
Version release V.A15
A9 with READme
SaddikD_A6 Uploaded
Questions to answer from the airline_stat.csv
What are all the airlines? What awk command did you use to get this information?
Which airlines have: (Include your awk command for part a and b)
Has a carrier delay greater than 10 and print airline names (alphabetically. Hint* pipe input into sort)
Has a carrier delay greater than a certain threshold of 15? Use -v to pass in a value that is set to 'Threshold = 15'
Submission Instruction
Create a txt file (airline_inquiry.txt) with answers to the questions above
Save the history of your commands in file with "history > a6_cmds.log"
Git add and commit the directory _A6 with the airline_inquiry.txt and a6_cmds.log files
Git push your repo.
When you are complete and ready to let me know that you done with the assignment, create a new release with the tag 'V.A6'. Add a short description on what the assignment is.
SaddikD_A5 Uploaded
Working with structured command; if statements
Saddik-D_A4 Uploaded
This assingment involved using echo commands for bvarious operations (math, string, rounding floats, etc.)
I really am struggling to figure out how to puch from the command line but I have added the file echoing.sh manually.