使ucl phas结果更好
resultr的Python项目详细描述
结果
Makes UCL PHAS results better
注意很有可能我犯了错误,所以用一桶盐来做这个。
加州大学物理与天文学学院每年都以pdf格式发布研究结果,格式如下:
Candidate Number | Devcom | Module1 | Mark | Module2 | Mark | Module3 | Mark | Module4 | Mark | Module5 | Mark | Module6 | Mark | Module7 | Mark | Module8 | Mark | Provisional outcome |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ABCD0 | 100 | PHAS0000 | 99 | PHAS0001 | 98 | PHAS0002 | 97 | PHAS0003 | 96 | PHAS0004 | 95 | PHAS0005 | 94 | PHAS0006 | 93 | PHAS0007 | 92 | P |
ABCD1 | 24 | PHAS0003 | 93 | PHAS0001 | 55 | PHAS0004 | 43 | PHAS0007 | 40 | PHAS0002 | 34 | PHAS0006 | 25 | PHAS0005 | 15 | PHAS0000 | 3 | >> |
resultr允许您:
- 获取一年的加权平均值
- 在本年度获得您的排名
- 绘制容器中模块的结果直方图:(0,40),(40,50),(50,60),(60,70),(80,90),(90,100)
- 按模块重新格式化结果(如下所示)并输出到csv
输出格式:
Devcom | PHAS0000 | PHAS0001 | PHAS0002 | PHAS0003 | PHAS0004 | PHAS0005 | PHAS0006 | PHAS0007 | Averages |
---|---|---|---|---|---|---|---|---|---|
100 | 99 | 98 | 97 | 96 | 95 | 94 | 93 | 92 | 95.5 |
24 | 3 | 55 | 34 | 93 | 43 | 15 | 25 | 40 | 39 |
安装
$ pip install resultr
用法示例
需要:
- Python 3
- pandas和matplotlib用于绘图
- python-inquirer用于用户输入
使pdf可用
您需要将ucl提供的.pdf文件转换为csv,并用“,”分隔。为此,我使用了smallpdf的pdf-to-excel转换器(这使得xlsx对于pdf页面的每一页都有一个工作表)。然后我使用Google Docs将每张工作表导出为csv,并将它们组合到一个文本编辑器中(请注意,除了第一页之外,您应该删除所有页面的标题行(cand、devcom、module1等)
运行结果
您可以使用inquirer提示运行interact with resultr:
或者在运行resultr时传递参数:
$ resultr -h usage: resultr [-h][--input INPUT][--format FORMAT][--plot][--exportplots EXPORTPLOTS][--showplots][--my][--year YEAR][--rank][--candidate CANDIDATE] Makes UCL PHAS results better optional arguments: -h, --help show this help message and exit --input, -i INPUT csv file to import --format, -f FORMAT reformats results by module and exports it to file specified --plot, -p plot the module results --exportplots, -ep EXPORTPLOTS export all plots to /path/you/want/ --showplots, -sp show all plots --my, -m returns your weighted average for the year --year, -y YEAR specify your year --rank, -r returns your rank in the year --candidate, -c CANDIDATE specify your candidate number
发布历史记录
- 0.1.10条
- 长度将“cand”改为“cand”
- 0.1.9条
- 将args.exportplots和args.showplots传递到resultr\u plot.howplotargs
- 0.1.8条
- 将入口点更改为使用main.py
- 0.1.7条
- 将入口点添加到setup.py(resultr)
- 0.1.6条
- 分成resultr_format和resultr_plot
- 0.1.5分
- 已将matplotlib更改为与agg 一起运行
- 0.1.4条
- 在setup.py中添加了matplotlib要求
- 0.1.3条
- 在setup.py中添加了inquirer需求
- 0.1.2条
- 添加了pip
- 0.1.1条
- 将提示符和cli代码从
'__main__'
移动到main()
- 将名称更改为resultr原因酷
- 将提示符和cli代码从
- 0.1.0条
- 第一次正确释放
元
哈克·哈查特瑞安–hi@hayk.io
根据麻省理工学院的许可证发行。有关详细信息,请参见LICENSE
。
贡献
- 叉它(https://github.com/haykkh/resultr/fork)
- 创建功能分支(
git checkout -b feature/fooBar
) - 提交更改(
git commit -am 'Add some fooBar'
) - 推到分支(
git push origin feature/fooBar
) - 创建新的拉取请求