Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
gpfs-policy
Manage
Activity
Members
Labels
Plan
Issues
14
Issue boards
Milestones
Wiki
Code
Merge requests
4
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Package Registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
rc
gpfs-policy
Commits
df8d1a68
Commit
df8d1a68
authored
1 month ago
by
Matthew K Defenderfer
Browse files
Options
Downloads
Patches
Plain Diff
Fix logic for dealing with naked integers in prep_age_distribution
parent
c539f04f
No related branches found
No related tags found
2 merge requests
!76
Patch v0.5.1
,
!71
Fix logic for dealing with naked integers in prep_age_distribution
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/rc_gpfs/utils/core.py
+5
-3
5 additions, 3 deletions
src/rc_gpfs/utils/core.py
with
5 additions
and
3 deletions
src/rc_gpfs/utils/core.py
+
5
−
3
View file @
df8d1a68
...
...
@@ -70,9 +70,11 @@ def prep_age_distribution(
age_breakpoints
:
int
|
List
[
int
],
time_unit
:
Literal
[
'
D
'
,
'
W
'
]
)
->
Tuple
[
List
[
np
.
datetime64
],
List
[
str
]]:
if
any
([
b
<
0
for
b
in
age_breakpoints
]):
raise
ValueError
(
"
Timestamp cannot be newer than the current date time
"
)
age_breakpoints
=
list
(
set
(
age_breakpoints
))
if
not
isinstance
(
age_breakpoints
,
list
):
age_breakpoints
=
[
age_breakpoints
]
else
:
age_breakpoints
=
list
(
set
(
age_breakpoints
))
age_breakpoints
.
sort
()
age_breakpoints
=
[
t
for
t
in
age_breakpoints
if
t
>
0
]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment