|
30 | 30 | import subprocess |
31 | 31 | import webbrowser |
32 | 32 | import pandas as pd |
33 | | -import pkg_resources |
34 | 33 | import pyranges as pr |
35 | 34 | import logging.handlers |
36 | 35 | import pyarrow.feather as feather |
37 | 36 | # import darshan.backend.cffi_backend as darshanll |
38 | 37 |
|
| 38 | +from importlib import resources |
39 | 39 | from explorer import version as dxt_version |
40 | 40 | from packaging import version |
41 | 41 |
|
@@ -298,7 +298,7 @@ def create_dataframe( |
298 | 298 | temp_result["end"] = temp_result["end"].round(decimals=4) |
299 | 299 |
|
300 | 300 | temp_result.index.name = "segment" |
301 | | - temp_result.reset_index(inplace=True) |
| 301 | + temp_result = temp_result.reset_index() |
302 | 302 | temp_result = temp_result.reindex(columns=column_names) |
303 | 303 |
|
304 | 304 | df.append(temp_result) |
@@ -327,7 +327,7 @@ def create_dataframe( |
327 | 327 | temp_result["end"] = temp_result["end"].round(decimals=4) |
328 | 328 |
|
329 | 329 | temp_result.index.name = "segment" |
330 | | - temp_result.reset_index(inplace=True) |
| 330 | + temp_result = temp_result.reset_index() |
331 | 331 | temp_result = temp_result.reindex(columns=column_names) |
332 | 332 |
|
333 | 333 | df.append(temp_result) |
@@ -422,8 +422,8 @@ def merge_overlapping_io_phases(self, overlapping_df, df, module): |
422 | 422 | ] |
423 | 423 | ) |
424 | 424 |
|
425 | | - overlapping_df_end = overlapping_df[["End"]].to_numpy() |
426 | | - overlapping_df_start = overlapping_df[["Start"]].to_numpy() |
| 425 | + overlapping_df_end = overlapping_df["End"].to_numpy() |
| 426 | + overlapping_df_start = overlapping_df["Start"].to_numpy() |
427 | 427 | interval_duration = 0 |
428 | 428 |
|
429 | 429 | for i in range(len(overlapping_df_end) - 1): |
@@ -513,7 +513,8 @@ def merge_overlapping_io_phases(self, overlapping_df, df, module): |
513 | 513 | threshold, |
514 | 514 | ] |
515 | 515 |
|
516 | | - io_phases_df.dropna(inplace=True) |
| 516 | + io_phases_df = io_phases_df.dropna() |
| 517 | + |
517 | 518 | return io_phases_df |
518 | 519 |
|
519 | 520 | def calculate_io_phases( |
@@ -730,7 +731,7 @@ def generate_plot(self, file, report): |
730 | 731 | self.prefix, file_id, "snapshot", snapshot, "operation" |
731 | 732 | ) |
732 | 733 | path = "plots/operation.py" |
733 | | - script = pkg_resources.resource_filename(__name__, path) |
| 734 | + script = str(resources.files(__package__ or __name__).joinpath(path)) |
734 | 735 |
|
735 | 736 | command = "python3 {} -f {}.{}.{}-{}.dxt -i {}.{}.{}-{}.io_phases {} {} -o {} -x {} -t {} -r {}".format( |
736 | 737 | script, |
@@ -792,7 +793,7 @@ def generate_plot(self, file, report): |
792 | 793 | self.prefix, file_id, "operation" |
793 | 794 | ) |
794 | 795 | path = "plots/operation.py" |
795 | | - script = pkg_resources.resource_filename(__name__, path) |
| 796 | + script = str(resources.files(__package__ or __name__).joinpath(path)) |
796 | 797 |
|
797 | 798 | command = "python3 {} -f {}.{}.dxt -i {}.{}.io_phases{} {} -o {} -x {}".format( |
798 | 799 | script, |
@@ -864,7 +865,7 @@ def generate_transfer_plot(self, file, report): |
864 | 865 | output_file = "{}/{}-{}.html".format(self.prefix, file_id, "transfer") |
865 | 866 |
|
866 | 867 | path = "plots/transfer.py" |
867 | | - script = pkg_resources.resource_filename(__name__, path) |
| 868 | + script = str(resources.files(__package__ or __name__).joinpath(path)) |
868 | 869 |
|
869 | 870 | command = "python3 {} -f {}.{}.dxt {} -o {} -x {}".format( |
870 | 871 | script, file, file_id, limits, output_file, file_name |
@@ -912,7 +913,7 @@ def generate_spatiality_plot(self, file, report): |
912 | 913 | output_file = "{}/{}-{}.html".format(self.prefix, file_id, "spatiality") |
913 | 914 |
|
914 | 915 | path = "plots/spatiality.py" |
915 | | - script = pkg_resources.resource_filename(__name__, path) |
| 916 | + script = str(resources.files(__package__ or __name__).joinpath(path)) |
916 | 917 |
|
917 | 918 | command = "python3 {} -f {}.{}.dxt -o {} -x {}".format( |
918 | 919 | script, file, file_id, output_file, file_name |
@@ -959,7 +960,7 @@ def generate_phase_plot(self, file, report): |
959 | 960 | for file_id, file_name in file_ids.items(): |
960 | 961 | output_file = "{}/{}-{}.html".format(self.prefix, file_id, "io_phase") |
961 | 962 | path = "plots/io_phase.py" |
962 | | - script = pkg_resources.resource_filename(__name__, path) |
| 963 | + script = str(resources.files(__package__ or __name__).joinpath(path)) |
963 | 964 |
|
964 | 965 | command = "python3 {} -f {}.{}.io_phases -o {} -x {}".format( |
965 | 966 | script, file, file_id, output_file, file_name |
@@ -1007,7 +1008,7 @@ def generate_ost_usage_operation_plot(self, file, report): |
1007 | 1008 | self.prefix, file_id, "ost_usage_operation" |
1008 | 1009 | ) |
1009 | 1010 | path = "plots/ost_usage_operation.py" |
1010 | | - script = pkg_resources.resource_filename(__name__, path) |
| 1011 | + script = str(resources.files(__package__ or __name__).joinpath(path)) |
1011 | 1012 |
|
1012 | 1013 | command = "python3 {} -f {}.{}.dxt -o {} -x {}".format( |
1013 | 1014 | script, file, file_id, output_file, file_name |
@@ -1057,7 +1058,7 @@ def generate_ost_usage_transfer_plot(self, file, report): |
1057 | 1058 | self.prefix, file_id, "ost_usage_transfer" |
1058 | 1059 | ) |
1059 | 1060 | path = "plots/ost_usage_transfer.py" |
1060 | | - script = pkg_resources.resource_filename(__name__, path) |
| 1061 | + script = str(resources.files(__package__ or __name__).joinpath(path)) |
1061 | 1062 |
|
1062 | 1063 | command = "python3 {} -f {}.{}.dxt -o {} -x {}".format( |
1063 | 1064 | script, file, file_id, output_file, file_name |
|
0 commit comments