plot_hiv_by_age_and_gender
create_title(base_title='', node_id=None, gender=None, show_avg_per_run=False, show_fraction=False, show_fraction_of=False, fraction_of_str='', hiv_negative=False, has_age_bins=False)
Use the input arguments to create a title for the plot (and filename).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
base_title
|
str
|
This is the core string to place in the title. It describes the specific data being plotted. |
''
|
node_id
|
int
|
The ID of the node for which the data is being filtered for. |
None
|
gender
|
str
|
The string (Male or Female) for the gender that data is being filtered for. |
None
|
show_avg_per_run
|
bool
|
True indicates that the data is an average over multiple runs. |
False
|
show_fraction
|
bool
|
True indicates that the data is not true counts but a fraction (i.e. a count divided by another counter) |
False
|
show_fraction_of
|
bool
|
When the denominator of the fraction can be different things, say population or infected, this allows you to specify the option that is not population. |
False
|
fraction_of_str
|
str
|
If 'show_fraction_of' is true, then this argument an be used to include in the plot what the denominator is. |
''
|
hiv_negative
|
bool
|
If True, then the title will indicate that the data is for people without HIV. |
False
|
has_age_bins
|
bool
|
If True, then 'by Age' is added to the title. |
False
|
Returns:
| Type | Description |
|---|---|
str
|
A string to be used a the top line title of the plot. |
Source code in emodpy_hiv/plotting/plot_hiv_by_age_and_gender.py
create_y_axis_name(base_title='', node_id=None, gender=None, show_avg_per_run=False, show_fraction=False, show_fraction_of=False, fraction_of_str='', has_age_bins=False)
Given the arguments, create a label for the y-axis that describes the data being plotted.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
base_title
|
str
|
This is the core string to place in the y-label. It describes what is being plotted. |
''
|
node_id
|
int
|
TBD |
None
|
gender
|
str
|
The string (Male or Female) for the gender that data is being filtered for. |
None
|
show_avg_per_run
|
bool
|
TBD |
False
|
show_fraction
|
bool
|
True indicates that the data is not true counts but a fraction (i.e. a count divided by another counter) |
False
|
show_fraction_of
|
bool
|
When the denominator of the fraction can be different things, say population or infected, this allows you to specify the option that is not population. |
False
|
fraction_of_str
|
str
|
If 'show_fraction_of' is true, then this argument an be used to include in the plot what the denominator is. |
''
|
has_age_bins
|
bool
|
TBD |
False
|
Returns:
| Type | Description |
|---|---|
str
|
A string to be used a the top line title of the plot. |
Source code in emodpy_hiv/plotting/plot_hiv_by_age_and_gender.py
extract_population_data(filename, node_id=None, gender=None, age_bin=None, other_strat_column_name=None, other_strat_value=None)
Extract population data for a specific node, gender and age.
It is assumed that the file has ages every 5 years from 0 to 100.
Source code in emodpy_hiv/plotting/plot_hiv_by_age_and_gender.py
176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 | |
extract_population_data_by_stratification(filename, node_id=None, gender=None, age_bin_list=None, start_column_name=None, strat_values=None)
Extract population data such that you get the population for each stratification.
Source code in emodpy_hiv/plotting/plot_hiv_by_age_and_gender.py
386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 | |
extract_population_data_multiple_ages(filename, node_id=None, gender=None, age_bin_list=None, filter_by_hiv_negative=False, other_strat_column_name=None, other_strat_value=None, other_data_column_names=None)
Extract population data for multiple ages for a specific node and gender.
Source code in emodpy_hiv/plotting/plot_hiv_by_age_and_gender.py
261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 | |
plot_circumcision_by_age(filename, age_bin_list, fraction_of_total=False, img_dir=None)
For a single file, plot the number of men who are circumcised by age.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filename
|
(str, required)
|
The name and path of the ReportHIVByAgeAndGender.csv to extract the data from. |
required |
age_bin_list
|
list[float]
|
A list of ages in years where the population with risk value will be counted for each bin. For example, if you enter [10, 25, 30, 55], there will be three age bins with the following ranges: [10-25), [25-30), [30-55) |
required |
fraction_of_total
|
bool
|
If True, the number of men who are circumcised will be divided by the total number of men with that stratification. |
False
|
img_dir
|
str
|
Directory to save the images. If None, the images will not be saved and a window will be opened. |
None
|
Returns:
Source code in emodpy_hiv/plotting/plot_hiv_by_age_and_gender.py
954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 | |
plot_columns(filename, title, y_axis_name, column_names, fraction_of_population=False, img_dir=None)
For a given file, plot the indicated columns versus time (i.e. Year).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filename
|
(str, required)
|
The name and path of the ReportHIVByAgeAndGender.csv file to extract the data from. |
required |
title
|
(str, required)
|
The title to put at the top of the plot. |
required |
y_axis_name
|
(str, required)
|
The name to label the y-axis on the plot. |
required |
column_names
|
(list[str], required)
|
The list of column names to plot the data for. The report has a space before each column name. Please be sure to include it. |
required |
fraction_of_population
|
bool
|
If True, divide the count each column by the population for the same stratification. |
False
|
img_dir
|
str
|
Directory to save the images. If None, the images will not be saved and a window will be opened. |
None
|
Returns:
Source code in emodpy_hiv/plotting/plot_hiv_by_age_and_gender.py
plot_onART_by_age(dir_or_filename, exp_dir_or_filename=None, node_id=None, gender=None, age_bin_list=None, show_avg_per_run=False, show_fraction=False, fraction_of_infected=False, img_dir=None)
Create a plot showing information about the people on ART. You can show the fraction of the population or the fraction of the infected population.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dir_or_filename
|
(str, required)
|
The directory or filename containing the ReportHIVByAgeAndGender.csv files. |
required |
exp_dir_or_filename
|
(str, required)
|
The expected or alternate directory or filename containing the ReportHIVByAgeAndGender.csv files. |
None
|
node_id
|
int
|
The ID of the node for which the data is being filtered for. |
None
|
gender
|
str
|
The string (Male or Female) for the gender that data is being filtered for. |
None
|
age_bin_list
|
list[float]
|
A list of ages in years where the population with risk value will be counted for each bin. For example, if you enter [10, 25, 30, 55], there will be three age bins with the following ranges: [10-25), [25-30), [30-55) |
None
|
show_avg_per_run
|
bool
|
If 'dir_or_filename' is a directory, this will calculate the average number of people with the given risk type at a given time step between the files. Default is False. |
False
|
show_fraction
|
bool
|
True indicates that the number of people on ART will be divided by either the number of people in the population or the number of infected people. It depends on the 'fraction_of_infected' parameter. |
False
|
fraction_of_infected
|
bool
|
If 'show_fraction' is True, then this parameter determines what the divisor is when creating the fraction. If it is True, it will divide the number of people on ART by the number of infected people. If it is False, the divisor will the total population with that stratification. |
False
|
img_dir
|
str
|
Directory to save the images. If None, the images will not be saved and a window will be opened. |
None
|
Returns:
Source code in emodpy_hiv/plotting/plot_hiv_by_age_and_gender.py
1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 | |
plot_population_by_age(dir_or_filename, exp_dir_or_filename=None, node_id=None, gender=None, age_bin_list=None, show_avg_per_run=False, img_dir=None)
Create a plot showing the population over time.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dir_or_filename
|
(str, required)
|
The directory or filename containing the ReportHIVByAgeAndGender.csv files. |
required |
exp_dir_or_filename
|
(str, required)
|
The expected or alternate directory or filename containing the ReportHIVByAgeAndGender.csv files. |
None
|
node_id
|
int
|
The ID of the node for which the data is being filtered for. |
None
|
gender
|
str
|
The string (Male or Female) for the gender that data is being filtered for. |
None
|
age_bin_list
|
list[float]
|
A list of ages in years where the population with risk value will be counted for each bin. For example, if you enter [10, 25, 30, 55], there will be three age bins with the following ranges: [10-25), [25-30), [30-55) |
None
|
show_avg_per_run
|
bool
|
If 'dir_or_filename' is a directory, this will calculate the average number of people with the given risk type at a given time step between the files. Default is False. |
False
|
img_dir
|
str
|
Directory to save the images. If None, the images will not be saved and a window will be opened. |
None
|
Returns:
Source code in emodpy_hiv/plotting/plot_hiv_by_age_and_gender.py
plot_population_by_age_vs_unworld_pop(filename, unworld_pop_filename, age_bin_list, country, version, x_base_population=1.0, img_dir=None)
For a single file, plot the actual population for a given age bin versus what was expected in the given UN World Population file. If you have define three age bins, there will be six curves - an actual and an expected for each bin.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filename
|
(str, required)
|
The name and path of the ReportHIVByAgeAndGender.csv file to plot the data from. |
required |
unworld_pop_filename
|
(str, required)
|
The name and path to a UN World Pop Excel spreadsheet where the 'country' parameter specifies a country name found in the spreadsheet and the 'version' specifies the year of the data. These values are needed to know how to read the data in the spreadsheet. |
required |
age_bin_list
|
(list[float], required)
|
A list of ages in years where the population with risk value will be counted for each bin. For example, if you enter [10, 25, 30, 55], there will be three age bins with the following ranges: [10-25), [25-30), [30-55) |
required |
country
|
(str, required)
|
The name of the country found in the spreadsheet to extract the data for. |
required |
version
|
(str, required)
|
The year associated with when the UN World Pop file was created. PLEASE NOTE: This year is a string. |
required |
x_base_population
|
float
|
The 'x_Base_Population' value (found in the config) is used to divide by the population numbers in the CSV file so you get numbers that match the true population. |
1.0
|
img_dir
|
str
|
Directory to save the images. If None, the images will not be saved and a window will be opened. |
None
|
Returns:
Source code in emodpy_hiv/plotting/plot_hiv_by_age_and_gender.py
1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 | |
plot_population_by_gender(filename, img_dir=None)
For the given file, plot the population for each gender over time.
Args filename (str, required): The name and path of the ReportHIVByAgeAndGender.csv file to extract the data from.
img_dir (str, optional):
Directory to save the images. If None, the images will not be saved and a window will be opened.
Returns:
Source code in emodpy_hiv/plotting/plot_hiv_by_age_and_gender.py
plot_population_by_ip(dir_or_filename, exp_dir_or_filename=None, node_id=None, gender=None, age_bin_list=None, ip_key=None, ip_values=None, show_avg_per_run=False, show_fraction=False, expected_values=None, img_dir=None)
For the indicated files, create a plot showing who has what value of the give IP key over time.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dir_or_filename
|
(str, required)
|
The directory or filename containing the ReportHIVByAgeAndGender.csv files. |
required |
exp_dir_or_filename
|
(str, required)
|
The expected or alternate directory or filename containing the ReportHIVByAgeAndGender.csv files. |
None
|
node_id
|
int
|
The ID of the node for which the data is being filtered for. |
None
|
gender
|
str
|
The string (Male or Female) for the gender that data is being filtered for. |
None
|
age_bin_list
|
list[float]
|
A list of ages, in years, where the population with risk value will be counted for each bin. For example, if you enter [10, 25, 30, 55], there will be three age bins with the following ranges: [10-25), [25-30), [30-55) |
None
|
ip_key
|
(str, required)
|
Extract the data from the files based on this IP stratification column. If the files has not been stratified by this IP, you will need to re-run the simulations with stratification turned on. |
None
|
ip_values
|
list[str]
|
By default, this plotting tool uses all of the values for the IP, however, this allows you to only include the ones you are interested (i.e. a subset to the total possible values for the IP) |
None
|
show_avg_per_run
|
bool
|
If 'dir_or_filename' is a directory, this will calculate the average number of people with the given risk type at a given time step between the files. Default is False. |
False
|
show_fraction
|
bool
|
True indicates that the number of people the given IP value will be divided by the sum of all the people with all of the selected IP values. For example, if the IP key were Risk and you selected to only plot LOW and MEDIUM, then the total number of people with LOW will be divided by the total number of people with either LOW or MEDIUM. |
False
|
expected_values
|
dict
|
If the user provides this dictionary, the constant expected value of each IP will be plotted. This should be a dictionary with an IP value as the key and a constant expected value. There should be an IP value for each IP value plotted. |
None
|
img_dir
|
str
|
Directory to save the images. If None, the images will not be saved and a window will be opened. |
None
|
Returns:
Source code in emodpy_hiv/plotting/plot_hiv_by_age_and_gender.py
744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 | |
plot_population_for_dir(dir_or_filename, unworld_pop_filename, country, version, x_base_population=1.0, show_avg_per_run=False, gender=None, age_bin=None, img_dir=None)
Plot the population for the given age bin against the data in the UN World Population spreadsheet.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dir_or_filename
|
(str, required)
|
The directory or filename containing the ReportHIVByAgeAndGender.csv files. |
required |
unworld_pop_filename
|
(str, required)
|
The name and path to a UN World Pop Excel spreadsheet where the 'country' parameter specifies a country name found in the spreadsheet and the 'version' specifies the year of the data. These values are needed to know how to read the data in the spreadsheet. |
required |
country
|
(str, required)
|
The name of the country found in the spreadsheet to extract the data for. |
required |
version
|
(str, required)
|
The year associated with when the UN World Pop file was created. PLEASE NOTE: This year is a string. |
required |
x_base_population
|
float
|
The 'x_Base_Population' value (found in the config) is used to divide by the population numbers in the CSV file so you get numbers that match the true population. |
1.0
|
show_avg_per_run
|
bool
|
If 'dir_or_filename' is a directory, this will calculate the average number of people with the given risk type at a given time step between the files. Default is False. |
False
|
gender
|
str
|
The string (Male or Female) for the gender that data is being filtered for. |
None
|
age_bin
|
float
|
If provided, the data for this specific age stratification will be plotted. Both the data in the report file and the UN World Pop file must have this stratification. If you do not provide a value, then the population is not broken up by age (i.e. total population). |
None
|
img_dir
|
str
|
Directory to save the images. If None, the images will not be saved and a window will be opened. |
None
|
Returns:
Source code in emodpy_hiv/plotting/plot_hiv_by_age_and_gender.py
557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 | |
plot_prevalence_for_dir(dir_or_filename, exp_dir_or_filename=None, node_id=None, gender=None, age_bin_list=None, show_avg_per_run=False, show_fraction=False, img_dir=None)
Create a plot showing who is infected with HIV.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dir_or_filename
|
(str, required)
|
The directory or filename containing the ReportHIVByAgeAndGender.csv files. |
required |
exp_dir_or_filename
|
(str, required)
|
The expected or alternate directory or filename containing the ReportHIVByAgeAndGender.csv files. |
None
|
node_id
|
int
|
The ID of the node for which the data is being filtered for. |
None
|
gender
|
str
|
The string (Male or Female) for the gender that data is being filtered for. |
None
|
age_bin_list
|
list[float]
|
A list of ages in years where the population with risk value will be counted for each bin. For example, if you enter [10, 25, 30, 55], there will be three age bins with the following ranges: [10-25), [25-30), [30-55) |
None
|
show_avg_per_run
|
bool
|
If 'dir_or_filename' is a directory, this will calculate the average number of people with the given risk type at a given time step between the files. Default is False. |
False
|
show_fraction
|
bool
|
True indicates that the number of infected people should be divided by the total number of people in that stratification. |
False
|
img_dir
|
str
|
Directory to save the images. If None, the images will not be saved and a window will be opened. |
None
|
Returns:
Source code in emodpy_hiv/plotting/plot_hiv_by_age_and_gender.py
plot_risk(dir_or_filename, starting_expected_values=None, expected_value_for_high_per_node=None, gender=None, age_bin_list=None, show_avg_per_run=False, show_fraction=False, img_dir=None)
Create one plot for each node in 'expected_value_for_high_per_node' showing the risk values for the population versus what is expected.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dir_or_filename
|
(str, required)
|
The directory or filename containing the ReportHIVByAgeAndGender.csv files. |
required |
starting_expected_values
|
dict
|
The starting three values of how risk distributed to the population. These should be the same values that you have in the demographics. The order is LOW, MEDIUM, and HIGH. Typically, one might have 0.85 for LOW, 0.15 for MEDIUM, and 0.0 for HIGH because people get set to HIGH in the campaign's CSW logic. |
None
|
expected_value_for_high_per_node
|
list[float, optional]
|
A list of expected fraction of the population to have Risk = HIGH for a given node. The node ID of each value is expected to be the index of the position plus 1. The starting values for LOW and MEDIUM are adjusted for this HIGH value. |
None
|
gender
|
str
|
The string (Male or Female) for the gender that data is being filtered for. |
None
|
age_bin_list
|
list[float]
|
A list of ages in years where the population with risk value will be counted for each bin. For example, if you enter [10, 25, 30, 55], there will be three age bins with the following ranges: [10-25), [25-30), [30-55) |
None
|
show_avg_per_run
|
bool
|
If 'dir_or_filename' is a directory, this will calculate the average number of people with the given risk type at a given time step between the files. Default is False. |
False
|
show_fraction
|
bool
|
True indicates that for each stratification the number of people with a given risk value is divided by the total number of people in that stratification. |
False
|
img_dir
|
str
|
Directory to save the images. If None, the images will not be saved and a window will be opened. |
None
|
Returns:
Source code in emodpy_hiv/plotting/plot_hiv_by_age_and_gender.py
1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 | |
plot_risk_zambia(dir_or_filename, age_bin_list=None, show_avg_per_run=False, show_fraction=False, show_expected=False, img_dir=None)
Create multiple risk value plots where each plot is for a specific node and gender. The plot can show the count or fraction of the group that has one of the three risk values. The plot can also show the expected values for specific node and gender for Zambia.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dir_or_filename
|
(str, required)
|
The directory or filename containing the ReportHIVByAgeAndGender.csv files. |
required |
age_bin_list
|
list[float]
|
A list of ages in years where the population with risk value will be counted for each bin. For example, if you enter [10, 25, 30, 55], there will be three age bins with the following ranges: [10-25), [25-30), [30-55) |
None
|
show_avg_per_run
|
bool
|
If 'dir_or_filename' is a directory, this will calculate the average number of people with the given risk type at a given time step between the files. Default is False. |
False
|
show_fraction
|
bool
|
True indicates that the data is not true counts but a fraction (i.e. a count divided by another counter) |
False
|
show_expected
|
bool
|
True indicates that you want to see the expected fractions of the population that have the different risk values PER NODE. False will be data for all nodes. |
False
|
img_dir
|
str
|
Directory to save the images. If None, the images will not be saved and a window will be opened. |
None
|
Returns:
Source code in emodpy_hiv/plotting/plot_hiv_by_age_and_gender.py
1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 | |
plot_vmmc_by_age(dir_or_filename, exp_dir_or_filename=None, node_id=None, age_bin_list=None, show_avg_per_run=False, img_dir=None)
Create a plot showing information about the men who are circumcised.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dir_or_filename
|
(str, required)
|
The directory or filename containing the ReportHIVByAgeAndGender.csv files. |
required |
exp_dir_or_filename
|
(str, required)
|
The expected or alternate directory or filename containing the ReportHIVByAgeAndGender.csv files. |
None
|
node_id
|
int
|
The ID of the node for which the data is being filtered for. |
None
|
age_bin_list
|
list[float]
|
A list of ages in years where the population with risk value will be counted for each bin. For example, if you enter [10, 25, 30, 55], there will be three age bins with the following ranges: [10-25), [25-30), [30-55) |
None
|
show_avg_per_run
|
bool
|
If 'dir_or_filename' is a directory, this will calculate the average number of people with the given risk type at a given time step between the files. Default is False. |
False
|
img_dir
|
str
|
Directory to save the images. If None, the images will not be saved and a window will be opened. |
None
|
Returns:
Source code in emodpy_hiv/plotting/plot_hiv_by_age_and_gender.py
plot_vmmc_for_dir(dir_or_filename, node_id=None, age_bin_list=None, show_expected=False, show_avg_per_run=False, img_dir=None)
Create a plot showing what fraction of men are circumcised over time versus the expected number of circumcised men.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dir_or_filename
|
(str, required)
|
The directory or filename containing the ReportHIVByAgeAndGender.csv files. |
required |
node_id
|
int
|
The ID of the node for which the data is being filtered for. |
None
|
age_bin_list
|
list[float]
|
A list of ages in years where the population with risk value will be counted for each bin. For example, if you enter [10, 25, 30, 55], there will be three age bins with the following ranges: [10-25), [25-30), [30-55) |
None
|
show_expected
|
bool
|
If true, plot the expected fraction of circumcisions. |
False
|
show_avg_per_run
|
bool
|
If 'dir_or_filename' is a directory, this will calculate the average number of people with the given risk type at a given time step between the files. Default is False. |
False
|
img_dir
|
str
|
Directory to save the images. If None, the images will not be saved and a window will be opened. |
None
|
Returns:
Source code in emodpy_hiv/plotting/plot_hiv_by_age_and_gender.py
1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 | |