1
Fork 0
mirror of https://github.com/pds-nest/nest.git synced 2024-11-21 20:44:18 +00:00

Merge branch 'main' of zero.ryg.one:nest/g2-progetto

This commit is contained in:
Annielated 2021-05-28 18:23:04 +02:00
commit 7b409cd3c2
17 changed files with 349 additions and 48 deletions

Binary file not shown.

View file

@ -2,3 +2,4 @@
====================================
.. automodule:: nest_crawler
:imported-members:

View file

@ -598,6 +598,11 @@ for example, any mapped columns or relationships.</p>
<code class="sig-name descname"><span class="pre">is_active</span></code><a class="headerlink" href="#nest_backend.database.tables.Repository.is_active" title="Link a questa definizione"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="nest_backend.database.tables.Repository.is_deleted">
<code class="sig-name descname"><span class="pre">is_deleted</span></code><a class="headerlink" href="#nest_backend.database.tables.Repository.is_deleted" title="Link a questa definizione"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="nest_backend.database.tables.Repository.evaluation_mode">
<code class="sig-name descname"><span class="pre">evaluation_mode</span></code><a class="headerlink" href="#nest_backend.database.tables.Repository.evaluation_mode" title="Link a questa definizione"></a></dt>

View file

@ -178,6 +178,41 @@
<div class="section" id="module-nest_crawler">
<span id="nest-crawler-crawler-in-python"></span><h1><code class="docutils literal notranslate"><span class="pre">nest_crawler</span></code> - Crawler in Python<a class="headerlink" href="#module-nest_crawler" title="Link a questa intestazione"></a></h1>
<dl class="py function">
<dt id="nest_crawler.associate_condition_tweet">
<code class="sig-prename descclassname"><span class="pre">nest_crawler.</span></code><code class="sig-name descname"><span class="pre">associate_condition_tweet</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">conditions_type</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">tweet</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#nest_crawler.associate_condition_tweet" title="Link a questa definizione"></a></dt>
<dd></dd></dl>
<dl class="py function">
<dt id="nest_crawler.authenticate">
<code class="sig-prename descclassname"><span class="pre">nest_crawler.</span></code><code class="sig-name descname"><span class="pre">authenticate</span></code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#nest_crawler.authenticate" title="Link a questa definizione"></a></dt>
<dd></dd></dl>
<dl class="py function">
<dt id="nest_crawler.is_coordinate_inside_bounding_box">
<code class="sig-prename descclassname"><span class="pre">nest_crawler.</span></code><code class="sig-name descname"><span class="pre">is_coordinate_inside_bounding_box</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">latitude</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">longitude</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">radius</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">tweet_latitude</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">tweet_longitude</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#nest_crawler.is_coordinate_inside_bounding_box" title="Link a questa definizione"></a></dt>
<dd></dd></dl>
<dl class="py function">
<dt id="nest_crawler.is_repo_alert_triggered">
<code class="sig-prename descclassname"><span class="pre">nest_crawler.</span></code><code class="sig-name descname"><span class="pre">is_repo_alert_triggered</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">repository_id</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#nest_crawler.is_repo_alert_triggered" title="Link a questa definizione"></a></dt>
<dd></dd></dl>
<dl class="py function">
<dt id="nest_crawler.search_repo_conditions">
<code class="sig-prename descclassname"><span class="pre">nest_crawler.</span></code><code class="sig-name descname"><span class="pre">search_repo_conditions</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">repository_id</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#nest_crawler.search_repo_conditions" title="Link a questa definizione"></a></dt>
<dd></dd></dl>
<dl class="py function">
<dt id="nest_crawler.send_notification_email">
<code class="sig-prename descclassname"><span class="pre">nest_crawler.</span></code><code class="sig-name descname"><span class="pre">send_notification_email</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">alert</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#nest_crawler.send_notification_email" title="Link a questa definizione"></a></dt>
<dd></dd></dl>
<dl class="py function">
<dt id="nest_crawler.send_notification_tweet">
<code class="sig-prename descclassname"><span class="pre">nest_crawler.</span></code><code class="sig-name descname"><span class="pre">send_notification_tweet</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">alert</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#nest_crawler.send_notification_tweet" title="Link a questa definizione"></a></dt>
<dd></dd></dl>
</div>

View file

@ -256,8 +256,14 @@
</li>
<li><a href="code/backend/index.html#nest_backend.database.tables.OperationType.assign">assign (nest_backend.database.tables.OperationType attributo)</a>
</li>
<li><a href="code/backend/index.html#nest_backend.gestione.authenticate">authenticate() (nel modulo nest_backend.gestione)</a>
<li><a href="code/crawler/index.html#nest_crawler.associate_condition_tweet">associate_condition_tweet() (nel modulo nest_crawler)</a>
</li>
<li><a href="code/backend/index.html#nest_backend.gestione.authenticate">authenticate() (nel modulo nest_backend.gestione)</a>
<ul>
<li><a href="code/crawler/index.html#nest_crawler.authenticate">(nel modulo nest_crawler)</a>
</li>
</ul></li>
<li><a href="code/backend/index.html#nest_backend.database.tables.Authorization">Authorization (classe in nest_backend.database.tables)</a>
</li>
<li><a href="code/backend/index.html#nest_backend.database.tables.Repository.authorizations">authorizations (nest_backend.database.tables.Repository attributo)</a>
@ -380,15 +386,21 @@
<li><a href="code/backend/index.html#nest_backend.database.tables.Repository.id">(nest_backend.database.tables.Repository attributo)</a>
</li>
</ul></li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="code/backend/index.html#nest_backend.gestione.identity">identity() (nel modulo nest_backend.gestione)</a>
</li>
<li><a href="code/backend/index.html#nest_backend.database.tables.Tweet.image_url">image_url (nest_backend.database.tables.Tweet attributo)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="code/backend/index.html#nest_backend.database.tables.Tweet.insert_time">insert_time (nest_backend.database.tables.Tweet attributo)</a>
</li>
<li><a href="code/backend/index.html#nest_backend.database.tables.Repository.is_active">is_active (nest_backend.database.tables.Repository attributo)</a>
</li>
<li><a href="code/crawler/index.html#nest_crawler.is_coordinate_inside_bounding_box">is_coordinate_inside_bounding_box() (nel modulo nest_crawler)</a>
</li>
<li><a href="code/backend/index.html#nest_backend.database.tables.Repository.is_deleted">is_deleted (nest_backend.database.tables.Repository attributo)</a>
</li>
<li><a href="code/crawler/index.html#nest_crawler.is_repo_alert_triggered">is_repo_alert_triggered() (nel modulo nest_crawler)</a>
</li>
<li><a href="code/backend/index.html#nest_backend.database.tables.User.isAdmin">isAdmin (nest_backend.database.tables.User attributo)</a>
</li>
@ -586,6 +598,14 @@
<h2 id="S">S</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="code/crawler/index.html#nest_crawler.search_repo_conditions">search_repo_conditions() (nel modulo nest_crawler)</a>
</li>
<li><a href="code/crawler/index.html#nest_crawler.send_notification_email">send_notification_email() (nel modulo nest_crawler)</a>
</li>
<li><a href="code/crawler/index.html#nest_crawler.send_notification_tweet">send_notification_tweet() (nel modulo nest_crawler)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="code/backend/index.html#nest_backend.database.tables.Composed.snowflake">snowflake (nest_backend.database.tables.Composed attributo)</a>
@ -595,8 +615,6 @@
<li><a href="code/backend/index.html#nest_backend.database.tables.Tweet.snowflake">(nest_backend.database.tables.Tweet attributo)</a>
</li>
</ul></li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="code/backend/index.html#nest_backend.database.tables.Repository.start">start (nest_backend.database.tables.Repository attributo)</a>
</li>
</ul></td>

Binary file not shown.

File diff suppressed because one or more lines are too long

View file

@ -2,3 +2,4 @@
====================================
.. automodule:: nest_crawler
:imported-members:

View file

@ -1,11 +1,6 @@
Sprint 0: 04 Apr - 18 Apr
=========================
.. todo::
Inserire informazioni generali sullo sprint, come inizio e fine.
Consegna
--------
@ -15,28 +10,28 @@ La seguente documentazione è stata fornita dal cliente durante questo sprint:
- :download:`Sprint 0 <0-sprint-requirements.pdf>`
Goal
----
Definition of ready
-------------------
.. todo::
Il team ha definito lo stato di Ready di una User Story in base ai seguenti criteri:
Inserire qui lo sprint goal.
Backlog
-------
.. todo::
Mostrare qui lo sprint backlog di Taiga.
• La User Story è stata compresa ed accettata da tutti i membri
• I tester hanno confermato la possibilità di poterla testare
• Il Product Owner ha la visione necessaria per definirne la priorità
• Il Team è in grado di stimarla
• La User Story è indipendente o dipendente da altre a priorità maggiore
Definition of done
------------------
.. todo::
La definizione di Done è stata concordata da tutto il team con il Product Owner, ed è stata così
definita:
Inserire qui la definition of done dello sprint.
• Sviluppo completo della funzionalità richiesta
• Definizione e superamento dei test
• Bozza della documentazione della funzionalità
• Merge dei sorgenti nel branch Main di GitLab
Registro attività
@ -171,7 +166,7 @@ Chiara Calzolari
- Durata
- Attività
* -
-
- 12h 30m
- Totale
* - 2021-04-09
@ -272,9 +267,219 @@ Lorenzo Balugani
Risultati della partita di Scrumble
-----------------------------------
.. todo::
.. list-table::
:header-rows: 1
* - GOAL
- QUESTIONS
- EVALUATION
- Chiara
- Giorgio
- Giovanni
- Stefano P.
- Lorenzo
- Stefano G.
- Flavia
- QUESTION
- METRIC
* - Learn
- Q1
- 1 = no idea of the Scrum roles 5 = perfect knowledge of the roles and their jobs
- 4
- 4
- 4
- 4
- 5
- 5
- 4
- Do team members understand the Scrum roles?
- Knowledge of Scrum roles by questions
* - Learn
- Q2
- 1 = couldn't repeat the game 5 = could play the game as a Scrum Master by himself
- 3
- 3
- 4
- 5
- 3
- 3
- 3
- Do team members feel they learned the process?
- Opinions from the participants
* - Learn
- Q3
- 1 = totally lost 5 = leads the game driving the other players
- 3
- 4
- 4
- 4
- 5
- 5
- 5
- Does everyone keep up with the other players?
- Check during every sprint retrospective if every one is on point
* - Practice
- Q4
- 1 = feels the game is unrepeatable 5 = feels the game could be played in any situation
- 1
- 2
- 1
- 1
- 1
- 2
- 1
- Are the game mechanics linear and repeatable?
- Opinions from the participants
* - Practice
- Q5
- 1 = 0 to 3 stories 2 = 4 to 6 3 = 7 to 9 4 = 10 to 12 5 = 13 to 15
- 5
- 5
- 5
- 5
- 5
- 5
- 5
- Do team success in completing the game?
- Number of User Stories completed
* - Practice
- Q6 (Only Dev. Team)
- 1 = abnormal difference from the other players 5 = coherent and uniform with the group most of the time
- 5
- 4
- 5
- 4
- 5
- /
- /
- Do team members efficiently estimate during sprint planning?
- Uniformity in evaluating the size and the priority of user stories
* - Cooperation
- Q7
- 1 = never speaks with the other players 5 = talks friendly to anyone in every situation
- 4
- 5
- 5
- 5
- 5
- 5
- 4
- Do team members know each other better?
- Level of players' serenity throughout the game
* - Cooperation
- Q8
- 1 = never puts effort in doing something 5 = every time is willing to understand what is going on
- 4
- 3
- 3
- 2
- 3
- 4
- 3
- Does the game let all players cooperate?
- Contribution of every player during the game
* - Cooperation
- Q9
- 1 = never asks for an opinion 5 = wants to discuss about every topic
- 5
- 5
- 5
- 3
- 5
- 4
- 5
- Do team member consult each other about a topic?
- Sharing of ideas
* - Motivation
- Q10
- 1 = not involved by the game 5 = always makes sure everyone is on point
- 3
- 5
- 5
- 4
- 5
- 4
- 4
- Do team members encourage collegues in need?
- Players explain something other players don't understand
* - Motivation
- Q11 (Only for PO)
- 1 = poor/absent advices 5 = wise and helpful suggestions when is required
- /
- /
- /
- /
- /
- 4
- /
- Does PO help the team?
- Quality of PO's advices to get better in the next sprints
* - Motivation
- Q12
- 1 = doesn't express opinions during retrospective 5 = feels the retrospective fundamental to express opinions
- 4
- 5
- 5
- 5
- 5
- 5
- 5
- Does the team come up with good ideas?
- Effectiveness of sprint retrospective
* - Problem Solving
- Q13
- On the game board, if the debt pawn is on the lowest stage,the evaluation is 5, for every higher stage it decreases by 1
- 5
- 5
- 5
- 5
- 5
- 5
- 5
- Do team members behave well when facing a problem?
- Level of the technical debt at the end of the game
* - Problem Solving
- Q14 (Only Dev. Team)
- Calculate the average of tasks left for each sprint: 1 = 21+ 2 = 16-20 3 = 11-15 4 = 6-10 5 = 0-5
- 5
- 5
- 5
- 5
- 5
- /
- /
- Does team organize their tasks properly?
- Average of tasks left at the end of each sprint
* - Problem Solving
- Q15 (Only for PO)
- Same evaluation as Q14 for the PO
- /
- /
- /
- /
- /
- 5
- /
- Does PO plan efficiently the Sprint Backlog?
- Average of tasks left at the end of each sprint
Trascrivere qui i risultati della partita di Scrumble.
Statistiche

View file

@ -4,7 +4,7 @@
|------|-----|--------|----------|
| | | | |
Totale generale di tutti i componenti: 12.5h
Totale generale di tutti i componenti: 39.5h
# Log attività individuali dello Sprint 3
@ -33,9 +33,16 @@ Lorenzo Balugani - DB & Backend Developer
| Data | Durata | Attività |
|-------|--------|----------|
| | | |
|17/5 |4h |Bugfixing, supporto alla localizzazione degli errori |
|18/5|2.0h|Bugfixing|
|20/5|3.0h|API autorizzazioni, refactoring|
|21/5|2.0h|Gestione tweet, rappresentazione tweet|
|24/5|2.0h|Bugfixing|
|25/5|4.0h|Docs, refactoring|
|27/5|3.0h|Bugfixing|
|28/5|6.0h|Bugfixing
|-------|--------|
|totale| __._h |
|totale| 22.0h |
Stefano Pigozzi - Sysadmin & Frontend Developer
@ -76,8 +83,10 @@ Chiara Calzolari - UI Designer
| 24/05 | 1.0h | Traduzione UI
| 25/05 | 1.0h | Traduzione UI
| 27/05 | 0.5h | Traduzione UI
| 28/05 | 2.0h | Configurazione ambiente di sviluppo
| 28/05 | 3.0h | Creazione video-demo
|-------|--------|
|totale| 12.5h |
|totale| 17.5h |

View file

@ -5,13 +5,13 @@ from nest_backend.gestione import *
import datetime
from flask_cors import cross_origin
from nest_backend.errors import *
import nest_backend.app
from nest_crawler.repo_search import search_repo_conditions
import threading
def tweet_importer(rid):
import nest_backend.app
with nest_backend.app.app.app_context():
search_repo_conditions(rid)

View file

@ -1 +1,4 @@
from .alert_trigger import *
from .associate_condition_tweet import *
from .authentication import *
from .repo_search import *

View file

@ -1,7 +1,7 @@
from nest_backend.database import *
from nest_backend.app import app, extension_sqlalchemy
from nest_crawler.repo_search import search_repo_conditions
from alert_trigger import is_repo_alert_triggered
from nest_backend.app import app
from .repo_search import search_repo_conditions
from .alert_trigger import is_repo_alert_triggered
ext.init_app(app=app)
@ -12,8 +12,7 @@ def search_all_repo():
search_repo_conditions(repo_id)
is_repo_alert_triggered(repo_id)
if __name__ == "__main__":
with app.app_context():
search_all_repo()

View file

@ -1,8 +1,9 @@
from datetime import datetime, timedelta
from nest_backend.database import *
from authentication import authenticate
from .authentication import authenticate
import smtplib
def is_repo_alert_triggered(repository_id):
repo = Repository.query.filter_by(id=repository_id).first()
if repo is None:
@ -56,6 +57,7 @@ def send_notification_email(alert):
if smtpObj is not None:
smtpObj.close()
def send_notification_tweet(alert):
api = authenticate()
conditions_string = ''
@ -65,3 +67,9 @@ def send_notification_tweet(alert):
print(conditions_string)
api.update_status(f"L'alert {alert.name} è stato attivato! C'è stato un incremento di popolarità negli argomenti di ricerca {conditions_string}")
__all__ = (
"is_repo_alert_triggered",
"send_notification_email",
"send_notification_tweet",
)

View file

@ -50,3 +50,9 @@ def is_coordinate_inside_bounding_box(latitude, longitude, radius, tweet_latitud
dLongitude = dLatitude * cos(radians(latitude))
if (latitude - dLatitude < tweet_latitude < latitude+dLatitude) and (longitude-dLongitude < tweet_longitude < longitude+dLongitude):
return True
__all__ = (
"associate_condition_tweet",
"is_coordinate_inside_bounding_box",
)

View file

@ -1,14 +1,20 @@
import tweepy as tw
import os
def authenticate():
c_k = "GEhtSyP9e98mzFeiOCSW0lvQX"
c_s = "438cmYrl5xqaX2W7I2Bf5A9nF1pN5VtM9f77WYQnAXg1BwKJ27"
a_t = "1380217745732689921-IW3U1JlxhnQeGBUrnHZ2nxbxhksXUZ"
a_t_s = "EUoYNoj72rb2q00tUIW8eTcLJAhUAYPstZlV78W9cPpEJ"
c_k = os.getenv('C_K')
c_s = os.getenv('C_S')
a_t = os.getenv('A_T')
a_t_s = os.getenv('A_T_S')
auth = tw.OAuthHandler(c_k, c_s)
auth.set_access_token(a_t, a_t_s)
api = tw.API(auth, wait_on_rate_limit=True)
# client = tw.Client(b_t, c_k, c_s, a_t, a_t_s, wait_on_rate_limit=True);
return api
__all__ = (
"authenticate",
)

View file

@ -1,8 +1,8 @@
from nest_backend.database import *
import nest_crawler.authentication as authentication
from datetime import datetime, timedelta
from . import authentication
from datetime import datetime
import tweepy as tw
from nest_crawler.associate_condition_tweet import associate_condition_tweet
from .associate_condition_tweet import associate_condition_tweet
def search_repo_conditions(repository_id):
@ -142,3 +142,8 @@ def search_repo_conditions(repository_id):
ext.session.add(composed)
ext.session.commit()
print(f"Done searching tweets from repo: {repo.name}")
__all__ = (
"search_repo_conditions",
)