|
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 |
|
@@ -730,7 +730,7 @@ def generate_plot(self, file, report): |
730 | 730 | self.prefix, file_id, "snapshot", snapshot, "operation" |
731 | 731 | ) |
732 | 732 | path = "plots/operation.py" |
733 | | - script = pkg_resources.resource_filename(__name__, path) |
| 733 | + script = str(resources.files(__package__ or __name__).joinpath(path)) |
734 | 734 |
|
735 | 735 | command = "python3 {} -f {}.{}.{}-{}.dxt -i {}.{}.{}-{}.io_phases {} {} -o {} -x {} -t {} -r {}".format( |
736 | 736 | script, |
@@ -792,7 +792,7 @@ def generate_plot(self, file, report): |
792 | 792 | self.prefix, file_id, "operation" |
793 | 793 | ) |
794 | 794 | path = "plots/operation.py" |
795 | | - script = pkg_resources.resource_filename(__name__, path) |
| 795 | + script = str(resources.files(__package__ or __name__).joinpath(path)) |
796 | 796 |
|
797 | 797 | command = "python3 {} -f {}.{}.dxt -i {}.{}.io_phases{} {} -o {} -x {}".format( |
798 | 798 | script, |
@@ -864,7 +864,7 @@ def generate_transfer_plot(self, file, report): |
864 | 864 | output_file = "{}/{}-{}.html".format(self.prefix, file_id, "transfer") |
865 | 865 |
|
866 | 866 | path = "plots/transfer.py" |
867 | | - script = pkg_resources.resource_filename(__name__, path) |
| 867 | + script = str(resources.files(__package__ or __name__).joinpath(path)) |
868 | 868 |
|
869 | 869 | command = "python3 {} -f {}.{}.dxt {} -o {} -x {}".format( |
870 | 870 | script, file, file_id, limits, output_file, file_name |
@@ -912,7 +912,7 @@ def generate_spatiality_plot(self, file, report): |
912 | 912 | output_file = "{}/{}-{}.html".format(self.prefix, file_id, "spatiality") |
913 | 913 |
|
914 | 914 | path = "plots/spatiality.py" |
915 | | - script = pkg_resources.resource_filename(__name__, path) |
| 915 | + script = str(resources.files(__package__ or __name__).joinpath(path)) |
916 | 916 |
|
917 | 917 | command = "python3 {} -f {}.{}.dxt -o {} -x {}".format( |
918 | 918 | script, file, file_id, output_file, file_name |
@@ -959,7 +959,7 @@ def generate_phase_plot(self, file, report): |
959 | 959 | for file_id, file_name in file_ids.items(): |
960 | 960 | output_file = "{}/{}-{}.html".format(self.prefix, file_id, "io_phase") |
961 | 961 | path = "plots/io_phase.py" |
962 | | - script = pkg_resources.resource_filename(__name__, path) |
| 962 | + script = str(resources.files(__package__ or __name__).joinpath(path)) |
963 | 963 |
|
964 | 964 | command = "python3 {} -f {}.{}.io_phases -o {} -x {}".format( |
965 | 965 | script, file, file_id, output_file, file_name |
@@ -1007,7 +1007,7 @@ def generate_ost_usage_operation_plot(self, file, report): |
1007 | 1007 | self.prefix, file_id, "ost_usage_operation" |
1008 | 1008 | ) |
1009 | 1009 | path = "plots/ost_usage_operation.py" |
1010 | | - script = pkg_resources.resource_filename(__name__, path) |
| 1010 | + script = str(resources.files(__package__ or __name__).joinpath(path)) |
1011 | 1011 |
|
1012 | 1012 | command = "python3 {} -f {}.{}.dxt -o {} -x {}".format( |
1013 | 1013 | script, file, file_id, output_file, file_name |
@@ -1057,7 +1057,7 @@ def generate_ost_usage_transfer_plot(self, file, report): |
1057 | 1057 | self.prefix, file_id, "ost_usage_transfer" |
1058 | 1058 | ) |
1059 | 1059 | path = "plots/ost_usage_transfer.py" |
1060 | | - script = pkg_resources.resource_filename(__name__, path) |
| 1060 | + script = str(resources.files(__package__ or __name__).joinpath(path)) |
1061 | 1061 |
|
1062 | 1062 | command = "python3 {} -f {}.{}.dxt -o {} -x {}".format( |
1063 | 1063 | script, file, file_id, output_file, file_name |
|
0 commit comments