Skip to content

Commit

Permalink
Add the training script to src
Browse files Browse the repository at this point in the history
  • Loading branch information
fatou1526 committed Sep 19, 2023
1 parent dd83ce1 commit 60f351a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 21 deletions.
26 changes: 8 additions & 18 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,29 +37,19 @@ def generate_project_tree():
with open('requirements.txt', 'w') as requirements:
requirements.write('numpy\npandas\nmatplotlib\nscikit-learn\njupyter\n')
"""
# Création du fichier main_notebook.ipynb
with open('notebooks/main.ipynb', 'w') as notebook:
notebook.write('{ "cells": [], "metadata": {}, "nbformat": 4, "nbformat_minor": 2 }')
# Création du fichier utils.py
with open('src/utils.py', 'w') as utils:
utils.write('"""Contient les fonctions utilitaires pour le projet."""\n\n')
utils.write('def my_utils():\n')
utils.write(' pass\n')

# Création du fichier process.py
with open('src/process.py', 'w') as process:
process.write('"""Contient le preprocessing des données."""\n\n')
process.write('def processing():\n')
process.write(' pass\n')

"""
# Création du fichier train.py
with open('src/utils.py', 'w') as utils:
utils.write(' """Contient entrainement du modele."""\n\n')
utils.write('def training():\n')
utils.write(' pass\n')
with open('src/train.py', 'w') as training:
training.write(' """Contient entrainement du modele."""\n\n')
training.write('def training():\n')
training.write(' pass\n')

# Initialisation du dépôt Git
subprocess.run(['git', 'init'])
Expand All @@ -68,7 +58,7 @@ def generate_project_tree():
subprocess.run(['git', 'add', '.'])

# Commit des fichiers ajoutés
subprocess.run(['git', 'commit', '-m', 'Add notebooks and python scripts'])
subprocess.run(['git', 'commit', '-m', 'Add the training script to src'])

# Push des fichiers créer
subprocess.run(['git', 'push', 'origin', 'branche-1'])
Expand Down
4 changes: 4 additions & 0 deletions src/train.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"""Contient entrainement du modele."""

def training():
pass
3 changes: 0 additions & 3 deletions src/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
"""Contient entrainement du modele."""

def training():
pass

0 comments on commit 60f351a

Please sign in to comment.