Skip to content

Commit

Permalink
Added django dashboard and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wleong1 committed Mar 6, 2024
1 parent 6a65adf commit 8684356
Show file tree
Hide file tree
Showing 30 changed files with 357 additions and 720 deletions.
77 changes: 77 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: ci
on:
push:
branches:
- '*'
permissions:
contents: write
jobs:
deploy:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Configure Git Credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- uses: actions/setup-python@v5
with:
python-version: 3.x
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v4
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- run: pip install mkdocs "mkdocstrings[python]" mkdocs-material
- run: mkdocs gh-deploy --force

mypy:
runs-on: ubuntu-latest
name: Mypy
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.x
uses: actions/setup-python@v1
with:
python-version: 3.x
- name: Install Dependencies
run: |
pip install mypy
- name: mypy
run: |
mypy src/
pylint:
runs-on: ubuntu-latest
name: pylint
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.x
uses: actions/setup-python@v1
with:
python-version: 3.x
- name: Install Dependencies
run: |
pip install pylint
- name: pylint
run: |
pylint src/
pytest:
runs-on: ubuntu-latest
name: pytest
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.x
uses: actions/setup-python@v1
with:
python-version: 3.x
- name: Install Dependencies
run: |
pip install pytest
- name: pytest
run: |
pytest tests/
18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM ubuntu:22.04

# set a directory for the app
WORKDIR /usr/workspace/

# copy all the files to the container
COPY . .

# install dependencies
RUN apt-get update
RUN apt-get install -y python3
RUN apt install -y python3-pip
RUN pip install --no-cache-dir -r requirements.txt

# EXPOSE 8000

# CMD cd django-stock-tracker && python3 manage.py runserver 0.0.0.0:8000 Can run this in the terminal
# but need to specify docker run -it -p 8888:8000 stock
3 changes: 2 additions & 1 deletion django-stock-tracker/home/views.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from django.shortcuts import render
from django.http import HttpResponse, JsonResponse
import sys, json
sys.path.append("/home/wleong/Personal_project/StockTracker/")
sys.path.append("/usr/workspace/")
sys.path.append("/home/wleong/Personal_project/StockTracker")
from src.model import Model
from src.data_processing import DataProcessing
from src.live_price_display import LivePriceDisplay
Expand Down
15 changes: 15 additions & 0 deletions docs/explanation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
This part of the project documentation focuses on an
**understanding-oriented** approach. You'll get a
chance to read about the background of the project,
as well as reasoning about how it was implemented.

> **Note:** Expand this section by considering the
> following points:
- Give context and background on your library
- Explain why you created it
- Provide multiple examples and approaches of how
to work with it
- Help the reader make connections
- Avoid writing instructions or technical descriptions
here
6 changes: 6 additions & 0 deletions docs/how-to-guides.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
This part of the project documentation focuses on a
**problem-oriented** approach. You'll tackle common
tasks that you might have, with the help of the code
provided in this project.

To be continued.
30 changes: 30 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
This site contains the project documentation for the
'Calculators' project that is used mainly for individual
tax calculation purposes. Its aim is to provide users
with a fairly accurate amount of tax paid, given the
financial year and calculator.

## Table Of Contents

The documentation follows the best practice for
project documentation as described by Daniele Procida
in the [Diátaxis documentation framework](https://diataxis.fr/)
and consists of four separate parts:

1. [Tutorials](tutorials.md)
2. [How-To Guides](how-to-guides.md)
3. [Reference](reference.md)
4. [Explanation](explanation.md)

Quickly find what you're looking for depending on
your use case by looking at the different pages.

## Project Overview

::: src

## Acknowledgements
I want to thank my house plants for providing me with
a negligible amount of oxygen each day. Also, I want
to thank the sun for providing more than half of their
nourishment free of charge.
8 changes: 8 additions & 0 deletions docs/reference.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
This part of the project documentation focuses on
an **information-oriented** approach. Use it as a
reference for the technical implementation of the
`Calculators` project code.

::: src.live_price_display
::: src.news_display
::: src.model
16 changes: 16 additions & 0 deletions docs/tutorials.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
This part of the project documentation focuses on a
**learning-oriented** approach. You'll learn how to
get started with the code in this project.

> **Note:** Expand this section by considering the
> following points:
- Help newcomers with getting started
- Teach readers about your library by making them
write code
- Inspire confidence through examples that work for
everyone, repeatably
- Give readers an immediate sense of achievement
- Show concrete examples, no abstractions
- Provide the minimum necessary explanation
- Avoid any distractions
14 changes: 14 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
site_name: Stock Tracker

theme:
name: "material"

plugins:
- mkdocstrings

nav:
- Stock Tracker Docs: index.md
- tutorials.md
- How-To Guides: how-to-guides.md
- reference.md
- explanation.md
188 changes: 0 additions & 188 deletions models/forecasting-algorithms/ARIMA_forecast.py

This file was deleted.

Loading

0 comments on commit 8684356

Please sign in to comment.