Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge in allocation% for next 3(?) months into reactions table in project-summaries #93

Open
yongrenjie opened this issue May 2, 2023 · 0 comments

Comments

@yongrenjie
Copy link
Contributor

yongrenjie commented May 2, 2023

Shouldn't be super hard, the necessary functions should already exist (?)

So instead of

Name, 😄, 👍, 👎

as the columns, we'd have

Name, 😄, 👍, 👎, Availability 2023-05, 2023-06, 2023-07

(for example.)

The monthly allocation% is already calculated as part of the person summary (although maybe we might want to move it to another module to avoid the potential of future cyclic imports)

whatwhat/lib/person.ml

Lines 32 to 40 in a63c076

let calculate_allocation_percentage
(asns : assignment list)
(month : [> `Year | `Month ] CL.Date.date)
=
let weeks = Utils.get_turing_weeks_in_month month in
let fte_weeks = List.map (get_fte_weeks_in_week asns) weeks |> FTE.sum in
let expected_fte_weeks = FTE.Weeks (float_of_int @@ List.length weeks) in
FTE.div fte_weeks expected_fte_weeks
;;

and the output tables should be easy to edit as they're dynamically constructed from a list of list of strings

whatwhat/lib/pretty.ml

Lines 61 to 69 in a63c076

(** Construct a table from a list of lists. Each nested list is one row of the
table. The number of columns of the resulting table will correspond to the
length of the longest nested list. *)
let make_table
?(header_rows : int = 0)
?(column_padding : int = 0)
(rows : string list list)
: string
=

so the necessary functionality should all be there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant