Skip to content

Commit 51e0f38

Browse files
Add asset path utility and integrate it into main window; adjust column properties in UI
1 parent 600d92d commit 51e0f38

10 files changed

Lines changed: 5418 additions & 6 deletions

asset_path.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import sys, os
2+
from pathlib import Path
3+
4+
5+
def asset_path(*parts) -> str:
6+
# When frozen (PyInstaller --onefile), files are unpacked into sys._MEIPASS
7+
base = Path(getattr(sys, "_MEIPASS", Path(__file__).resolve().parent))
8+
return str(base.joinpath("assets", *parts))

ui/main_window.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
from tkinter import ttk
2424
import webbrowser
2525

26+
from asset_path import asset_path
2627
from live_processing.correlogram import open_correlogram_wizard
2728
from live_processing.reliability_calculator import open_reliability_wizard
2829
from live_processing.sampler import sample_data
@@ -76,11 +77,6 @@ def _open_help_docs():
7677
def _open_report_bug():
7778
webbrowser.open("https://github.com/tmaier-kettering/CodebookAI/issues/new")
7879

79-
def asset_path(*parts) -> str:
80-
# When frozen by PyInstaller, data are unpacked under sys._MEIPASS
81-
base = Path(getattr(sys, "_MEIPASS", Path(__file__).resolve().parent))
82-
return str(base.joinpath("assets", *parts))
83-
8480

8581
def build_ui(root: tk.Tk) -> None:
8682
"""
@@ -96,6 +92,7 @@ def build_ui(root: tk.Tk) -> None:
9692
root: The main Tkinter window to build the UI in
9793
"""
9894
root.title(APP_TITLE)
95+
root.iconbitmap(asset_path("app.ico"))
9996

10097
# ===== Top-level grid: header, spacer, table area =====
10198
root.columnconfigure(0, weight=1)

ui/ui_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def populate_treeview(tree: ttk.Treeview, columns: tuple[str, ...], rows: list[t
3939
tree["show"] = "headings"
4040
for col in columns:
4141
tree.heading(col, text=col)
42-
tree.column(col, anchor="w")
42+
tree.column(col, anchor="w", stretch=True, width=60, minwidth=20)
4343

4444
# Clear existing rows
4545
for iid in tree.get_children():
13.4 KB
Binary file not shown.

wiki/Example/financial_sentiment.csv

Lines changed: 2501 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
text,id,emotion
2+
Finnish fibers and plastic products maker Suominen Corporation said its net loss narrowed to 1.6 mln euro $ 2.0 mln in the first nine months of 2006 from 2.16 mln euro $ 2.7 mln in the same period of 2005 .,209,positive
3+
Net profit in the same period in 2006 was ( x20ac ) 172 million .,1587,neutral
4+
"Dealers said the share was largely hit by investor disappointment about a refining margin of just 9.48 usd per barrel for the quarter and the performance of its shipping unit , which saw EBIT drop to 5 mln eur from 20 mln eur a year amid a fall in volumes and tanker rates .",42,negative
5+
"Target company : Tieto Corporation , Business Identity Code : 0101138-5 Date of change in holding : 22 January 2010 Portion of the shares and votes : The current group holding of OP-Pohjola Group Central Cooperative ( OPK ) is 2982 587 shares , which represents 4.14 % of the shares and voting rights .",1076,neutral
6+
The total capacity of the factory will be approximately 100 engines a year .,1851,neutral
7+
"The payment of 2.779 million litas in interest on a long-term loan provided by Ragutis ' majority shareholder , Estonia 's A. Le Coq , also added to the losses .",1839,negative
8+
The EPS improved to EUR0 .38 from EUR0 .27 .,580,positive
9+
The company specialises in temporary electrification and heating at construction sites .,1909,neutral
10+
"Operating profit totaled EUR 6.7 mn , down from EUR 7.2 mn in the corresponding period in 2005 .",1974,negative
11+
"Nokia said it still expects to sell 150 more million Symbian devices in years to come , giving an indication of how it expects the Phone 7 handoff to work .",1042,neutral
12+
The diluted loss per share narrowed to EUR 0.27 from EUR 0.86 .,1910,positive
13+
The amending of the proposal simplifies the proposed plan and increases the incentive for key employees to stay in the Company .,87,positive
14+
"Operating profit for the 12-month period decreased from EUR17 .9 m while net sales increased from EUR58 .3 m , as compared to 2007 .",1491,negative
15+
Scanfil holdings include 100 % of contract electronics manufacturer Scanfil EMS Group .,586,neutral
16+
"ADPnews - Aug 3 , 2009 - Finnish media group Ilkka-Yhtyma Oyj HEL : ILK2S said today its net profit fell 45 % on the year to EUR 5.9 million USD 8.4 m in the first half of 2009 .",377,neutral
17+
com and possibly also through photo-msn .,2139,neutral
18+
The rebuilds are designed to improve the machines ' performance and product quality .,1461,positive
19+
"However , net sales in 2010 are seen to have grown to EUR598 .3 m from EUR582 .3 m in 2009 .",1348,positive
20+
The value of the firm 's forestry holdings increased by SEK 3.6 bn .,1389,positive
21+
"However , the offering will probably not be made at the current valuation , which partly derives from the deal in which the company was merged into a stock market shell .",110,neutral
22+
"According to HK Ruokatalo , almost all the meat used by the company comes from Finland .",1507,neutral
23+
Cash flow from operations rose to EUR 52.7 mn from EUR 15.6 mn in 2007 .,831,positive
24+
"Under Finnish law , Parliament grants licences to build nuclear power plants .",781,neutral
25+
"Following its strategy , Tikkurila has established a fully-owned sales company TOO Tikkurila in Almaty , Kazakhstan , for marketing decorative paints under the Finnish Tikkurila brand and the Russian Teks brand .",540,neutral
26+
"The Whitehall Street Real Estate Funds invest in real estate and real estate related assets , principally through the acquisition of real estate companies , real property and mortgage loans .",289,neutral
27+
These savings will have full impact as of the beginning of 2007 .,1623,neutral
28+
@chessNwine: $IWM 30-Minute Chart. Small caps threatening descending triangle breakdown under $110.20. http://stks.co/r0KKm,206,negative
29+
$LNKD Daily Phase 2 retest - Price experiencing early rejection. Can it retest? http://stks.co/t04xX,128,negative
30+
"FTSE falls to 3-month low on Greek debt concerns, easyJet skids",2430,negative
31+
"After the split , the number of K shares will be 9 540 000 and the number of A shares 26 885 540 .",1472,neutral
32+
"The liquidity providing was interrupted on May 11 , 2007 when Aspocomp Group Oyj 's shares traded below 0.50 cent ( Aspocomp 's stock exchange release 11.5.2007 ) .",526,negative
33+
"In addition , MIDs are always online and enable full Internet browsing .",152,neutral
34+
"When open next year , it will be the largest facility in the world to produce diesel fuel from renewable feedstock such as palm oil and animal fat .",1157,positive
35+
Net sales fell by 5 % from the previous accounting period .,1100,negative
36+
Kone said in court papers that the union action delayed repairs to elevators at the federal courthouse on Jan. 21 and the Saltonstall state office building on Jan. 23 .,2299,neutral
37+
"DBS, Julius Baer emerge as potential bidders for Barclays Asia wealth unit ...",250,positive
38+
Tesco leads leap in FTSE 100; Marks & Spencer drops,834,positive
39+
Shell and BG Shareholders to Vote on Deal at End of January,2244,neutral
40+
"Ahlstrom , headquartered in Helsinki , Finland , is a global company involved in the development , manufacture and marketing of high performance fibre-based materials .",2365,neutral
41+
"Combining the two producers will create a strong EU-based fertilizer industry capable of meeting global competition , they added .",1751,positive
42+
"( ADP News ) - Oct 31 , 2008 - Finnish food company Raisio Oyj ( OMX : RAIVV ) said today that its net profit jumped to EUR 16.4 million ( USD 20.9 m ) for the first nine months of 2008 from EUR 1.1 million for the same period of 2",554,positive
43+
The value of the order is EUR 4mn .,2174,neutral
44+
The transactions would increase earnings per share in the first quarter by some EUR0 .28 .,2282,positive
45+
$GOOGL Hit With Lawsuit from Russian Search Engine $YNDX http://stks.co/b1kD8,2359,negative
46+
"$XLF http://stks.co/1KJ9 Bounced off target buy area, bought $skf as a hedge. watch 50ma's slope",556,negative
47+
"The RME from Telcontar enables the handset to calculate the best route and includes support for user-defined routes , feature navigability and multi-modal routing such as via foot and ferry .",644,neutral
48+
"Finnish shipping company Finnlines , of the Grimaldi Group , reports its net sales decreased to EUR 241.8 mn in January-June 2009 from EUR 384.0 mn in the corresponding period in 2008 .",1443,negative
49+
"CS Cabot exports 55 % of its production mainly to Goodyear , Bridgestone and Michelin plants in Poland , as well as to Germany 's Michelin or Italy 's Pirelli through the company 's logistics center in Paris , Stefan said .",1697,neutral
50+
"With CapMan as a partner , we will be able to further develop our business and continue to focus on providing quality restaurant services for our customers , '' says Christopher Wynne , CEO of Papa John 's Russia .",201,positive
51+
TELE2 Affarsvarlden gave a `` buy '' recommendation on mobile operator Tele2 AB and a share price target of 142 crowns ( $ 23.54 - 15.19 euro ) .,1957,positive
52+
The company also said that it will sell approximately 150 hectares of land to the city of Valkeakoski by the end of the year a part of its `` From job to job '' program .,1984,neutral
53+
MarketsBP promotes upstream boss to deputy CEO,388,neutral
54+
$FTI Breakout today after reporting earnings last night,614,positive
55+
Whitbread share price climbs on Q4 sales growth,124,positive
56+
NaturalGas Settles At 3-year Low $DBO $BNO http://stks.co/d27qX,1438,negative
57+
"Body ES Vostok also owns stakes in power sales companies MosenergosbytBody ( RTS : MSSB ) ( 50.9 % ) , Altaienergosbyt ( 100 % ) , Saratovenergo ( RTS : SARE ) Body ( 48.36 % ) and Tambov Power Sales Company ( RTS : TASB ) ( 49.01 % ) , all ofBodywhich it received from the distribution balance .",1070,neutral
58+
Operating profit rose to EUR 26.7 mn from EUR 14.9 mn in the corresponding period in 2006 .,2037,positive
59+
CompaniesDixons Carphone to close 134 UK stores as sales jump,1261,positive
60+
He wore a black beanie-type cap and a black jacket .,471,neutral
61+
`` Our customer has been satisfied with Basware Invoice Automation solution and extends the implementation to new geographies .,1181,positive
62+
A total 30 % of the order value was booked in the fourth quarter of 2009 and the remainder will be booked in the second quarter of 2010 .,109,neutral
63+
"The prosecutor is also demanding Outokumpu pay a fine of EUR 800,000 at most .",1321,neutral
64+
"Compared with the FTSE 100 index , which rose 94.9 points ( or 1.6 % ) on the day , this was a relative price change of -0.4 % .",2338,neutral
65+
"ADP News - Apr 22 , 2009 - Finnish business information systems developer Solteq Oyj HEL : STQ1V said today its net loss widened to EUR 189,000 USD 245,000 for the first quarter of 2009 from EUR 10,000 for the same peri",876,neutral
66+
"In April-June 2008 , Scanfil 's net sales totalled EUR 58.7 mn and operating profit EUR 6.6 mn .",1890,neutral
67+
Brazilian mobile player Telemig Celular yesterday announced that it has selected Finnish software developer Tecnomen Oyj to expand its prepaid billing system .,2136,positive
68+
"STORA ENSO , NORSKE SKOG , M-REAL , UPM-KYMMENE Credit Suisse First Boston ( CFSB ) raised the fair value for shares in four of the largest Nordic forestry groups .",1616,positive
69+
"Talvik says the relocation of application programs on servers will continue , while HP servers were approved because of HP supplying a tailor-made solution to Elisa .",1536,neutral
70+
"As a part of the plan , the Board of Directors decided to transfer a maximum of 330,000 shares held by the company in a share issue against payment directed to Aspo Management Oy , a holding company acquired by the management .",1400,neutral
71+
$spy bumping its head on declining daily 8ma as overhead resistance. Then the big brother 50ma just above that.,966,negative
72+
AB InBev looks to win over SABMiller investors,1403,positive
73+
"L&G still paying price for dividend cut during crisis, chief says",21,negative
74+
With this acquisition Panostaja Oyj further expands its business area specialising in digital printing .,2390,positive
75+
Capital base and capital adequacy measurement is based on approaches under Basel II .,1088,neutral
76+
"The company is involved in the the sale of financial products including insurance , mortgages , car and personal loans , financial brokerage and equipment finance leasing .",910,neutral
77+
Major Order in India Comptel Corporation has received a significant long-term order for mediation and provisioning solutions being used by a leading operator in India .,863,positive
78+
EMSA Deputy Chairman of the Board Juri Lember told BNS on Wednesday that this was the first time he heard about the strike as the Swedish side had not informed the Estonian union yet .,1845,negative
79+
"PRESS: Serco Set To Appoint Roy Gardner, Ex-Centrica, As Chairman - FT",312,positive
80+
Barclays appoints JPMorgan's Paul Compton as new COO,1318,neutral
81+
"The payment of 2.779 million litas in interest on a long-term loan provided by Ragutis ' majority shareholder , Estonia 's A. Le Coq , also added to the losses .",600,neutral
82+
"Outotec , headquartered in Espoo , Finland , is a leading provider of process solutions , technologies and services for the mining and metallurgical industries .",318,neutral
83+
"In Finland , Hamina Cargo Terminal , of Finnish Nurminen Logistics , has purchased a warehouse with ground lease rights in the Port of Hamina .",2028,neutral
84+
"Ragutis , which is controlled by the Finnish brewery , reported a 5.4-per-cent rise in beer sales to 10.44 million litres and held an 11.09-per-cent market share .",158,positive
85+
The acquisition of +àlandsbanken Sverige in 2009 burdened the performance with EUR 3.0 mn .,1700,negative
86+
"Earnings per share for the quarter were also higher year-on-year at 0.33 eur versus 0.27 , and above market expectations of 0.28 eur .",265,positive
87+
$SPY weak close,646,negative
88+
BRIEF-Aviva aims to increase dividend pay-out ratio to 50 pct in 2017,521,positive
89+
"( ADP News ) - Feb 11 , 2009 - Finnish management software solutions provider Ixonos Oyj ( HEL : XNS1V ) said today its net profit rose to EUR 3.5 million ( USD 4.5 m ) for 2008 from EUR 3.1 million for 2007 .",1646,positive
90+
"$RNN day traders flushed out, it should start going up slowly from now on .",2331,positive
91+
You 're not alone .,239,neutral
92+
Changes to the as-built models from the design were communicated to the subcontractors to accommodate them into the steel and GRC glass reinforced concrete fabrication process .,2117,neutral
93+
"The total restructuring costs are expected to be about EUR 30mn , of which EUR 13.5 mn was booked in December 2008 .",928,neutral
94+
@Vegastrader66 Looks like good entry for $QIHU here.,2091,positive
95+
"More than 50,000 tonnes of asphalt mix will be used in the contract .",83,neutral
96+
The companies signed the letter of intent for the sale on 17 September 2010 and envisaged to seal the actual agreement on 1 January 2011 .,1784,neutral
97+
"The Board established a Remuneration Committee with following members : - Sari Baldauf Chairman - Tapio Hintikka - Heikki Westerlund In addition , the Board decided to appoint a Nomination Committee at a later stage .",1581,neutral
98+
I don't see it. 200 day sma is the big hurdle. There is a good base building. $NFLX https://t.co/ImKYGO2cyc,677,positive
99+
The parties have agreed not to disclose the transaction value .,880,neutral
100+
"Operating profits in the half were 0.8 m , down from 0.9 m as Glisten invested in the brand and the management team .",406,neutral
101+
"Aldata Solution Oyj Stock Exchange Release 11 August 2006 , at 11.00 am ALDATA SHARES SUBSCRIBED FOR WITH 2003 STOCK OPTIONS A total of 95,000 new shares of Aldata Solution Oyj have been subscribed for with the company 's 2003A stock options .",1231,neutral

0 commit comments

Comments
 (0)