Jelajahi Sumber

error on missing prices

raylu 2 minggu lalu
induk
melakukan
2393a206d9
3 mengubah file dengan 11 tambahan dan 3 penghapusan
  1. 11 3
      py/prepare.py
  2. 0 0
      www/data/company-data-jun26.json
  3. 0 0
      www/data/prod-data-jun26.json

+ 11 - 3
py/prepare.py

@@ -58,18 +58,28 @@ def get_prices(f: typing.TextIO) -> typing.Mapping[str, float]:
 	hardcoded_prices = {
 		'ANZ': 70601,
 		'BFP': 23408,
+		'BGS': 219000,
 		'CRU': 169623,
 		'FUN': 124010,
 		'GCH': 18303,
 		'GNZ': 30361,
+		'HAM': 4686751,
 		'HNZ': 93580,
+		'HPR': 1490000,
+		'LU': 95730,
 		'PFG': 2677222,
 		'RDS': 598170,
+		'RDL': 1390000,
 		'SDM': 1721027,
+		'SEQ': 17977,
 		'SST': 5863587,
 		'SU': 157860,
+		'TAC': 245797,
+		'TCU': 155561,
 		'TOR': 540169,
 		'VCB': 673713,
+		'VOE': 3699358,
+		'VOR': 2547315,
 	}
 	assert frozenset(prices).isdisjoint(hardcoded_prices), frozenset(prices).intersection(hardcoded_prices)
 	prices.update(hardcoded_prices)
@@ -84,9 +94,7 @@ def get_prod_and_company_data(data: dict[str, list[Row]], prices: typing.Mapping
 	for section, rows in data.items():
 		if (ticker := get_production_ticker(section)) is None:
 			continue
-		price = prices.get(ticker)
-		if price is None:
-			continue
+		price = prices[ticker]
 		prod_amount = sum(row.num for row in rows) / 30
 		prod[ticker] = {'amount': prod_amount, 'volume': prod_amount * price}
 		for row in rows:

File diff ditekan karena terlalu besar
+ 0 - 0
www/data/company-data-jun26.json


File diff ditekan karena terlalu besar
+ 0 - 0
www/data/prod-data-jun26.json


Beberapa file tidak ditampilkan karena terlalu banyak file yang berubah dalam diff ini