-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhmj.py
executable file
·40 lines (33 loc) · 1.17 KB
/
hmj.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/opt/homebrew/bin/python3.11
# Universal
import os
import calmap
import calplot
import pandas as pd
import numpy as np
from vega_datasets import data as vds
import matplotlib.pyplot as plt
import sqlite3
conn4=sqlite3.connect('/Users/blaine/6003TimeTracking/cb/mytime.db')
# Specific to subsections of the projects
# FROM newTimeSpent WHERE ProjectID LIKE '[1-9][1-9][1-9]g' Failed
# FROM newTimeSpent where ProjectID BETWEEN 001 and 999
## Manuscripts
datam = pd.read_sql( '''
SELECT DateDashed, ProjectID, SUM(TimeHr) TimeHr
FROM newTimeSpent where ProjectID BETWEEN 001 and 999
GROUP BY DateDashed
''',conn4)
datam['Date'] = pd.to_datetime(datam['DateDashed'])
datam = datam.set_index('Date')
isinstance(datam.index, pd.DatetimeIndex)
GhrPerDay = pd.Series(datam.TimeHr)
calplot.calplot(data=GhrPerDay, cmap='Blues', vmin=0.0, how=None, figsize=(16,10));
plt.suptitle('Manuscript Writing Effort', y=1.0, fontsize=20);
#plt.savefig('hmj.png', dpi=300, w)
# Remove old version and write updated version
strFile = "/Users/blaine/6003TimeTracking/cb/hmj.png"
if os.path.isfile(strFile):
os.remove(strFile) # Opt.: os.system("rm "+strFile)
plt.savefig(strFile, dpi=300)
plt.show()