Skip to content

Commit

Permalink
Chores/ media perimter updaet (#177)
Browse files Browse the repository at this point in the history
* chores: M6 1245

* test
  • Loading branch information
polomarcus authored Jun 6, 2024
1 parent 4cbcc98 commit 077f44b
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 22 deletions.
98 changes: 84 additions & 14 deletions postgres/program_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -422,11 +422,11 @@
{
"channel_name": "m6",
"start": "12:45",
"end": "13:35",
"end": "13:15",
"weekday": 1,
"program_name": "JT 1245",
"program_type": "Information - Journal",
"duration": 50,
"duration": 30,
"channel_title": "M6",
"public": false,
"infocontinue": false,
Expand All @@ -447,6 +447,20 @@
"radio": false,
"id": "cc4a2d02331449f4198431a47bb31c24150033a6f09d6d2a525ecc8c870654aa"
},
{
"channel_name": "m6",
"start": "13:15",
"end": "13:50",
"weekday": 1,
"program_name": "1245 le mag",
"program_type": "Information - Magazine",
"duration": 35,
"channel_title": "M6",
"public": false,
"infocontinue": false,
"radio": false,
"id": "ab6d5ba4be05d1934a02cce4b2da91af591d927321292941081a52a30ae453bd"
},
{
"channel_name": "m6",
"start": "19:40",
Expand Down Expand Up @@ -1304,11 +1318,11 @@
{
"channel_name": "m6",
"start": "12:45",
"end": "13:35",
"end": "13:15",
"weekday": 2,
"program_name": "JT 1245",
"program_type": "Information - Journal",
"duration": 50,
"duration": 30,
"channel_title": "M6",
"public": false,
"infocontinue": false,
Expand All @@ -1329,6 +1343,20 @@
"radio": false,
"id": "e991f66c4a3e36501af628429f2e6a510b7ffcfd60058c29d6b4491a3baf7a0c"
},
{
"channel_name": "m6",
"start": "13:15",
"end": "13:50",
"weekday": 2,
"program_name": "1245 le mag",
"program_type": "Information - Magazine",
"duration": 35,
"channel_title": "M6",
"public": false,
"infocontinue": false,
"radio": false,
"id": "37e9c64c2628239dc0aced57f03759cc3c1701a2b9daa02400d199ead8c040e9"
},
{
"channel_name": "m6",
"start": "19:40",
Expand Down Expand Up @@ -2186,11 +2214,11 @@
{
"channel_name": "m6",
"start": "12:45",
"end": "13:35",
"end": "13:15",
"weekday": 3,
"program_name": "JT 1245",
"program_type": "Information - Journal",
"duration": 50,
"duration": 30,
"channel_title": "M6",
"public": false,
"infocontinue": false,
Expand All @@ -2211,6 +2239,20 @@
"radio": false,
"id": "d5dac14c9c635a22457a33ebddb84ed3df3e81d563a247995b0165292c90501c"
},
{
"channel_name": "m6",
"start": "13:15",
"end": "13:50",
"weekday": 3,
"program_name": "1245 le mag",
"program_type": "Information - Magazine",
"duration": 35,
"channel_title": "M6",
"public": false,
"infocontinue": false,
"radio": false,
"id": "1f2a404b610f6aa9db59773c40884039e73ad3d354b29a72b8e6df2802909c80"
},
{
"channel_name": "m6",
"start": "19:40",
Expand Down Expand Up @@ -3082,11 +3124,11 @@
{
"channel_name": "m6",
"start": "12:45",
"end": "13:35",
"end": "13:15",
"weekday": 4,
"program_name": "JT 1245",
"program_type": "Information - Journal",
"duration": 50,
"duration": 30,
"channel_title": "M6",
"public": false,
"infocontinue": false,
Expand All @@ -3107,6 +3149,20 @@
"radio": false,
"id": "147698b5152e12caa81bf40b19d5fd6ce09e82b99d0ceffc095b926d87dfd3d8"
},
{
"channel_name": "m6",
"start": "13:15",
"end": "13:50",
"weekday": 4,
"program_name": "1245 le mag",
"program_type": "Information - Magazine",
"duration": 35,
"channel_title": "M6",
"public": false,
"infocontinue": false,
"radio": false,
"id": "3d1e086ec13ae9aa11e73ab4d8151061a8d3781053d172285a42aa222a0ade25"
},
{
"channel_name": "m6",
"start": "19:40",
Expand Down Expand Up @@ -3950,11 +4006,11 @@
{
"channel_name": "m6",
"start": "12:45",
"end": "13:35",
"end": "13:15",
"weekday": 5,
"program_name": "JT 1245",
"program_type": "Information - Journal",
"duration": 50,
"duration": 30,
"channel_title": "M6",
"public": false,
"infocontinue": false,
Expand All @@ -3975,6 +4031,20 @@
"radio": false,
"id": "a83c43bb126cf5d2a6e5c43fe84ccbd2484161715379d300e8dcf2b316151396"
},
{
"channel_name": "m6",
"start": "13:15",
"end": "13:50",
"weekday": 5,
"program_name": "1245 le mag",
"program_type": "Information - Magazine",
"duration": 35,
"channel_title": "M6",
"public": false,
"infocontinue": false,
"radio": false,
"id": "23ef719dfc4ff89aaec9ab73f948335e9ef90a9591e96408db6e5a52dbeb677a"
},
{
"channel_name": "m6",
"start": "19:40",
Expand Down Expand Up @@ -4762,11 +4832,11 @@
{
"channel_name": "m6",
"start": "12:45",
"end": "13:35",
"end": "13:15",
"weekday": 6,
"program_name": "JT 1245",
"program_type": "Information - Journal",
"duration": 50,
"duration": 30,
"channel_title": "M6",
"public": false,
"infocontinue": false,
Expand Down Expand Up @@ -5490,11 +5560,11 @@
{
"channel_name": "m6",
"start": "12:45",
"end": "13:35",
"end": "13:15",
"weekday": 7,
"program_name": "JT 1245",
"program_type": "Information - Journal",
"duration": 50,
"duration": 30,
"channel_title": "M6",
"public": false,
"infocontinue": false,
Expand Down
3 changes: 2 additions & 1 deletion quotaclimat/data_processing/mediatree/channel_program.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@
{"channel_name":"fr3-idf","start":"7:00","end":"9:00","weekday":"weekday","program_name":"Ici Matin","program_type":"Information - Journal"}
{"channel_name":"fr3-idf","start":"12:00","end":"12:50","weekday":"*","program_name":"JT 12h","program_type":"Information - Journal"}
{"channel_name":"fr3-idf","start":"19:00","end":"19:55","weekday":"*","program_name":"JT 19h + météo","program_type":"Information - Journal"}
{"channel_name":"m6","start":"12:45","end":"13:35","weekday":"*","program_name":"JT 1245","program_type":"Information - Journal"}
{"channel_name":"m6","start":"12:45","end":"13:15","weekday":"*","program_name":"JT 1245","program_type":"Information - Journal"}
{"channel_name":"m6","start":"13:50","end":"17:20","weekday":"weekday","program_name":"1 jour un doc","program_type":"Information - Magazine"}
{"channel_name":"m6","start":"13:15","end":"13:50","weekday":"weekday","program_name":"1245 le mag","program_type":"Information - Magazine"}
{"channel_name":"m6","start":"19:40","end":"20:10","weekday":"*","program_name":"JT 1945 + météo","program_type":"Information - Journal"}
{"channel_name":"m6","start":"11:00","end":"12:30","weekday":5,"program_name":"66 minutes samedi","program_type":"Information - Magazine"}
{"channel_name":"m6","start":"16:35","end":"19:30","weekday":6,"program_name":"66 minutes","program_type":"Information - Magazine"}
Expand Down
14 changes: 7 additions & 7 deletions test/sitemap/test_update_pg_keywords.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
from test_utils import get_localhost, debug_df, compare_unordered_lists_of_dicts

logging.getLogger().setLevel(logging.INFO)
original_timestamp = 1706444334 * 1000 # Sun Jan 28 2024 13:18:54 GMT+0100
start = pd.to_datetime("2024-01-28 12:18:54", utc=True).tz_convert('Europe/Paris')
original_timestamp = 1706271523 * 1000 # Sun Jan 28 2024 13:18:54 GMT+0100
start = pd.to_datetime("2024-01-26 12:18:54", utc=True).tz_convert('Europe/Paris')
create_tables()

def test_delete_keywords():
Expand Down Expand Up @@ -197,9 +197,9 @@ def test_first_update_keywords():
,number_of_biodiversite_solutions_directes = get_themes_keywords_duration(plaintext, srt, start)

expected_keywords_with_timestamp = [
{'category': 'Ecosystème', 'keyword': 'conditions de vie sur terre', 'timestamp': 1706444349000, 'theme': 'changement_climatique_constat'},
{'category': 'Ecosystème','keyword': 'habitabilité de la planète', 'timestamp': 1706444334006, 'theme': 'changement_climatique_constat'},
{'category': 'General','keyword': 'digue', 'timestamp': 1706444366000, 'theme': 'adaptation_climatique_solutions'}
{'category': 'Ecosystème', 'keyword': 'conditions de vie sur terre', 'timestamp': original_timestamp + 15000, 'theme': 'changement_climatique_constat'},
{'category': 'Ecosystème','keyword': 'habitabilité de la planète', 'timestamp': original_timestamp + 6, 'theme': 'changement_climatique_constat'},
{'category': 'General','keyword': 'digue', 'timestamp': original_timestamp + 32000, 'theme': 'adaptation_climatique_solutions'}
]
assert result_after_update.id == result_before_update.id

Expand Down Expand Up @@ -239,6 +239,6 @@ def test_first_update_keywords():
assert number_of_biodiversite_solutions_directes == 0

# program
assert result_after_update.channel_program == "JT 1245"
assert result_after_update.channel_program_type == "Information - Journal"
assert result_after_update.channel_program == "1245 le mag"
assert result_after_update.channel_program_type == "Information - Magazine"

1 comment on commit 077f44b

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage

Coverage Report
FileStmtsMissCoverMissing
postgres
   insert_data.py44784%36–38, 57–59, 64
   insert_existing_data_example.py19384%25–27
postgres/schemas
   models.py1431093%117–124, 136–137, 195–196, 210–211
quotaclimat/data_ingestion
   scrap_sitemap.py1341787%27–28, 33–34, 66–71, 95–97, 138–140, 202, 223–228
quotaclimat/data_ingestion/ingest_db
   ingest_sitemap_in_db.py553733%21–42, 45–58, 62–73
quotaclimat/data_ingestion/scrap_html
   scrap_description_article.py36392%19–20, 32
quotaclimat/data_processing/mediatree
   api_import.py19812139%43–47, 52–64, 68–71, 77, 80–122, 128–143, 147–148, 161–173, 177–183, 196–207, 210–214, 220, 255–256, 260, 264–287, 290–292
   channel_program.py91990%21–23, 34–36, 50, 86, 95
   config.py15287%7, 16
   detect_keywords.py180498%178, 230–232
   update_pg_keywords.py443032%14–84, 105–106, 127–152, 158
   utils.py662365%18, 29–53, 56, 65, 81–82
quotaclimat/utils
   healthcheck_config.py291452%22–24, 27–38
   logger.py241154%22–24, 28–37
   sentry.py10280%21–22
TOTAL111429374% 

Tests Skipped Failures Errors Time
80 0 💤 0 ❌ 0 🔥 56.238s ⏱️

Please sign in to comment.