Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
outillage
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alice Brenon
outillage
Compare revisions
922f5f43d027d7f73c0a73a043f4f83aa317cf91 to 49c4cb60872edba32bc97a293a28d17fa6a23e63
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
abrenon/outillage
Select target project
No results found
49c4cb60872edba32bc97a293a28d17fa6a23e63
Select Git revision
Swap
Target
abrenon/outillage
Select target project
abrenon/outillage
1 result
922f5f43d027d7f73c0a73a043f4f83aa317cf91
Select Git revision
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (2)
Add a python data-analysis tool to extract statistical metrics from the raw measurements
· 62603b09
Alice Brenon
authored
1 year ago
62603b09
Remove commented-out line commited by mistake
· 49c4cb60
Alice Brenon
authored
1 year ago
49c4cb60
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
scripts/textometry/measure-partition.py
+37
-0
37 additions, 0 deletions
scripts/textometry/measure-partition.py
scripts/textometry/measure.hs
+0
-1
0 additions, 1 deletion
scripts/textometry/measure.hs
with
37 additions
and
1 deletion
scripts/textometry/measure-partition.py
0 → 100755
View file @
49c4cb60
#!/usr/bin/env -S PYTHONPATH=lib/python python3
from
GEODE
import
tabular
from
GEODE.Store
import
prepare
import
os
import
pandas
import
sys
def
keyOf
(
t
):
if
type
(
t
)
==
tuple
:
return
tuple
(
map
(
lambda
s
:
s
.
strip
(
'
:
'
),
t
))
else
:
return
t
.
strip
(
'
:
'
)
def
getStats
(
series
):
columns
=
[
'
mean
'
,
'
std
'
,
'
min
'
,
'
25%
'
,
'
50%
'
,
'
75%
'
,
'
max
'
]
return
series
.
describe
()[
columns
]
def
partitonStats
(
metric
,
partition
):
groups
=
{
keyOf
(
p
[
0
]):
p
[
1
]
for
p
in
partition
}
byGroup
=
{
g
:
getStats
(
groups
[
g
][
metric
])
for
g
in
groups
}
stats
=
pandas
.
DataFrame
(
byGroup
).
transpose
()
total
=
[
groups
[
g
][
metric
].
sum
()
for
g
in
groups
]
stats
[
'
total
'
]
=
total
cardinal
=
stats
[
'
total
'
].
sum
()
stats
[
'
percentage
'
]
=
[
f
"
{
round
(
100
*
t
/
cardinal
,
2
)
}
%
"
for
t
in
total
]
return
stats
def
measurePartition
(
path
,
key
,
metric
,
outputPath
):
measures
=
tabular
(
path
)
measures
[
'
count
'
]
=
1
groups
=
measures
.
groupby
(
key
)
stats
=
partitonStats
(
metric
,
measures
.
groupby
(
key
))
stats
.
to_csv
(
f
"
{
outputPath
}
"
,
sep
=
'
\t
'
)
if
__name__
==
'
__main__
'
:
measurePartition
(
*
sys
.
argv
[
1
:])
This diff is collapsed.
Click to expand it.
scripts/textometry/measure.hs
View file @
49c4cb60
...
...
@@ -25,7 +25,6 @@ instance DefaultOrdered Sizes
instance
ToNamedRecord
Sizes
type
Result
=
ArticleRecord
@
Sizes
@
Count
--type Result = ArticleRecord @ Sizes @ Count
measureIn
::
FilePath
->
FilePath
->
ArticleRecord
->
IO
()
measureIn
textRoot
treeRoot
article
=
do
...
...
This diff is collapsed.
Click to expand it.