Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Alan Marchiori
labtool
Commits
257e2cf2
Commit
257e2cf2
authored
Jan 13, 2022
by
Alan Marchiori
Browse files
working on stats
parent
aa07ed57
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
commands/db.py
View file @
257e2cf2
...
...
@@ -129,8 +129,7 @@ def stats():
raise
Exception
()
for
user
in
users
:
if
user
!=
'sd043'
:
continue
if
user
in
skip
:
continue
...
...
@@ -184,15 +183,69 @@ def stats():
else
:
return
x
grade_at
=
fix_date
(
hist
[
'grade'
][
'TOTAL'
][
'at'
])
"""
entering CSCI206-S21-62/acc026 labdir is Labs/Lab02
getting commits for projects/acc026%2FCSCI206-S21-62/repository/commits on Labs/Lab02
2021-02-09 18:04:40-05:00 : 2021-02-09 18:04:40-05:00, 2021-02-09 18:04:21-05:00, 2021-02-09 18:01:28-05:00, 2021-02-09 18:01:04-05:00, 2021-02-09 18:00:34-05:00, 2021-02-09 18:00:00-05:00, 2021-02-09 17:59:36-05:00, 2021-02-09 17:59:12-05:00, 2021-02-09 17:58:33-05:00, 2021-02-09 17:58:24-05:00, 2021-02-09 17:57:54-05:00
Dumping progress.
❌ Oops--Something went wrong in labtool (can't compare offset-naive and offset-aware datetimes).
--- Logging error ---
Traceback (most recent call last):
File "/home/amm042/src/labtool/lt.py", line 82, in <module>
main()
File "/usr/lib/python3/dist-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/usr/lib/python3/dist-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/usr/lib/python3/dist-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/lib/python3/dist-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/lib/python3/dist-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/lib/python3/dist-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/home/amm042/src/labtool/commands/db.py", line 189, in stats
all_grade_at.sort()
TypeError: can't compare offset-naive and offset-aware datetimes
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.8/logging/handlers.py", line 1008, in emit
smtp = smtplib.SMTP(self.mailhost, port, timeout=self.timeout)
File "/usr/lib/python3.8/smtplib.py", line 255, in __init__
(code, msg) = self.connect(host, port)
File "/usr/lib/python3.8/smtplib.py", line 339, in connect
self.sock = self._get_socket(host, port, self.timeout)
File "/usr/lib/python3.8/smtplib.py", line 310, in _get_socket
return socket.create_connection((host, port), timeout,
File "/usr/lib/python3.8/socket.py", line 808, in create_connection
raise err
File "/usr/lib/python3.8/socket.py", line 796, in create_connection
sock.connect(sa)
socket.timeout: timed out
Call stack:
File "/home/amm042/src/labtool/lt.py", line 96, in <module>
logger.exception('{}@{}: Unhanded exception (cwd={}, cmd={})'.format(
Message: "amm042@amm042: Unhanded exception (cwd=/home/amm042/src/labtool, cmd=['/home/amm042/src/labtool/lt.py', 'db', 'stats'])"
Arguments: ()
"""
grade_at
=
fix_date
(
hist
[
'grade'
][
'TOTAL'
][
'at'
])
all_grade_at
=
list
(
map
(
fix_date
,
[
val
[
'at'
]
for
part
,
val
in
hist
[
'grade'
].
items
()]))
all_grade_at
=
list
(
map
(
fix_date
,
[
val
[
'at'
]
for
part
,
val
in
hist
[
'grade'
].
items
()
if
part
!=
'feedback'
]))
all_grade_at
.
sort
()
print
(
"GRADE AT :"
,
grade_at
)
print
(
"ALL_GRADE_AT:"
,
all_grade_at
)
print
(
"ALL_GRADE_AT:"
,
min
(
all_grade_at
))
# fix for regenerated total timestamps
grade_at
=
min
(
all_grade_at
)
if
grade_at
.
tzinfo
==
None
and
commits
[
0
].
tzinfo
!=
None
:
# seems gitlab always has a timezone, we're not so good.
...
...
gradestat.json
0 → 100644
View file @
257e2cf2
This diff is collapsed.
Click to expand it.
plotstats/gradestat.json
→
plotstats/gradestat.json
.old
View file @
257e2cf2
File moved
plotstats/plot.py
View file @
257e2cf2
...
...
@@ -327,7 +327,7 @@ if 1:
axes
[
0
].
legend
(
loc
=
'lower right'
)
axes
[
0
].
set_ylabel
(
'Fraction of grades'
)
plt
.
tight_layout
()
plt
.
savefig
(
'lab_cdfs_v
2
.pdf'
)
plt
.
savefig
(
'lab_cdfs_v
3
.pdf'
)
plt
.
show
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment