Skip to content
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.

Commit

Permalink
documentation, minor corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
sdpython committed Feb 25, 2018
1 parent e76fc4e commit 86df50f
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 27 deletions.
46 changes: 24 additions & 22 deletions _doc/examples/automation/send_mails.py
Expand Up @@ -47,13 +47,22 @@
# On définit le contenu du mail.

cc = []
sujet = "Projet informatique 1A - notes de lectures"
sujet = "Commentaires Python pour un data scientist / économiste"
col_name = "Etudiant"
col_mail = "mail"
columns = ["Sujet", "Commentaires"]
col_group = "groupe"
delay_sending = False
check = None

skip = 0 # to start again after a failure

only = None
skip = 0
skiprows = 1
skiprows = 0

folder = os.path.normpath(os.path.abspath(os.path.join(
*([os.path.dirname(__file__)] + ([".."] * 5) + ["_data", "ecole", "ENSAE", "2016-2017", "1A_projet"]))))
student = os.path.join(folder, "Python_1A_pitch_projet_2017_reviews.xlsx")
*([os.path.dirname(__file__)] + ([".."] * 5) + ["_data", "ecole", "ENSAE", "2017-2018", "2A_projet"]))))
student = os.path.join(folder, "Python2A-2018-01.xlsx")
if not os.path.exists(student):
raise FileNotFoundError(student)

Expand All @@ -64,11 +73,14 @@
""" + \
"""
Voici mes remarques suite à la lecture de votre projet et de votre code.
Vous devrez consacrer une à deux minutes lors de la soutenance pour
répondre aux questions de code. Ce temps est en plus de la présentation.
N'oubliez pas de préparer une démonstration de votre programme,
c'une à deux minutes également en plus de votre présentation.
Bonjour,
Je m'excuse d'avoir tant tardé à vous transmettre ces commentaires
pris par ceux qui vous ont lus vos travaux. Nous avons noté
le rapport sur 16 points et la vidéo sur 4. Je vous prie de m'excuser
pour les fautes d'orthographes qui sont sans doute encore présentes.
Vous êtes plus de 120 à avoir choisi ce cours pour plus de 75 projets
lus par quatre personnes.
""".replace("\n", " ")

Expand All @@ -79,10 +91,6 @@
""".replace("\n", " ") + \
"""
Vous pouvez si vous le souhaitez assister à d'autres soutenances.
A vendredi,
Xavier
"""

Expand Down Expand Up @@ -117,22 +125,16 @@
# pour envoyer le mail.
# Si mailbox est None, la fonction affiche les résultats mais ne fait rien.

col_name = "Noms"
col_mail = "Contact"
columns = ["sujet", "Passage 2 juin", "Rapport",
"Code", "Question de code", "pitch"]

delay_sending = False

fLOG("connect", user)
mailbox = pymmails.sender.create_smtp_server("gmail", user, pwd)
fLOG("send")
# remplacer mailbox par None pour voir le premier mail sans l'envoyer
mails = enumerate_send_email(mailbox,
mails = enumerate_send_email(mailbox if not check else None, # put None here to see the first mail
sujet, user + "@gmail.com",
df, exc=True, fLOG=fLOG, delay_sending=delay_sending,
begin=begin, end=end, skip=skip,
cc=cc, only=only, col_group=None,
cc=cc, only=only, col_group=col_group,
col_name=col_name, col_mail=col_mail,
cols=columns)

Expand Down
5 changes: 3 additions & 2 deletions _unittests/ut_dnotebooks/test_1_2_3_coverage_notebook2d.py
@@ -1,6 +1,6 @@
#-*- coding: utf-8 -*-
"""
@brief test log(time=104s)
@brief test log(time=38s)
"""

import sys
Expand Down Expand Up @@ -39,7 +39,7 @@

from pyquickhelper.loghelper import fLOG
from pyquickhelper.filehelper import synchronize_folder
from pyquickhelper.pycode import get_temp_folder, add_missing_development_version
from pyquickhelper.pycode import get_temp_folder, add_missing_development_version, skipif_circleci
from pyquickhelper.ipythonhelper import execute_notebook_list, execute_notebook_list_finalize_ut, get_additional_paths


Expand Down Expand Up @@ -75,6 +75,7 @@ def a_test_notebook_runner(self, name, folder, valid=None, copy_folder=None):
temp, keepnote, additional_path=add_path, valid=valid)
execute_notebook_list_finalize_ut(res, fLOG=fLOG, dump=thismodule)

@skipif_circleci('Check failed: PyBfloat16_Type.tp_base != nullptr')
def test_notebook_some_nlp(self):
fLOG(
__file__,
Expand Down
8 changes: 5 additions & 3 deletions src/ensae_teaching_cs/automation_students/send_feedback.py
Expand Up @@ -31,7 +31,7 @@ def enumerate_feedback(df1, col_group="Groupe",
template_col=template_mail_columns,
engine="jinja2", exc=True, fLOG=noLOG):
"""
sends feedback to students
Sends feedback to students.
@param df1 dataframe
@param col_group name of the column which contains the group definition
Expand Down Expand Up @@ -197,7 +197,9 @@ def enumerate_send_email(mailbox, subject, fr, df1, cc=None, delay=[1000, 1500],
delay_sending=False, exc=True, skip=0, only=None,
**params):
"""
Send feedback to students
Sends feedback to students.
Set mailbox to None to see what the first
mail looks like before going through the whole list.
@param mailbox mailbox, see `create_smtp_server <http://www.xavierdupre.fr/app/pymmails/helpsphinx/pymmails/sender/email_sender.html?pymmails.sender.email_sender.create_smtp_server>`_,
if mailbox is None, the function displays the message and fails
Expand All @@ -207,7 +209,7 @@ def enumerate_send_email(mailbox, subject, fr, df1, cc=None, delay=[1000, 1500],
@param delay random delay between two mails
@param delay_sending returns functions
@param exc raise exception when mail is empty
@param skip skip the first mail
@param skip skip the first mails
@param only send only to these groups (group id)
@param params see @see fn enumerate_feedback
@return enumerate mails
Expand Down

0 comments on commit 86df50f

Please sign in to comment.