41 lines
		
	
	
		
			2.0 KiB
		
	
	
	
		
			Python
		
	
	
	
			
		
		
	
	
			41 lines
		
	
	
		
			2.0 KiB
		
	
	
	
		
			Python
		
	
	
	
| import unittest
 | |
| from pathlib import Path
 | |
| from concho.config import HtmlConfigurator, Config
 | |
| from concho.dell import DellConfiguratorParser2025
 | |
| from concho.procs_chooser import plot_configurators
 | |
| from concho.procs_chooser import ConfigPrice
 | |
| from concho.procs_chooser import ConfigFlopsPerEuro
 | |
| import logging
 | |
| 
 | |
| 
 | |
| class Test(unittest.TestCase):
 | |
| 
 | |
|     def __init__(self, *args, **kwargs):
 | |
|         super().__init__(*args, **kwargs)
 | |
|         self.plots_dir = Path('./plots/')
 | |
|         self.plots_dir.mkdir(exist_ok=True, parents=True)
 | |
|         logging.basicConfig(level=logging.INFO)
 | |
| 
 | |
|     def test_dell2_configs(self):
 | |
|         logging.info('Starting test_dell2_configs')
 | |
|         configurators = [
 | |
|             HtmlConfigurator(Path('catalogs/dell/2025-10/20251023 - Cat2 Conf 2-2-01_ Dell Poweredge R660xs.html'), DellConfiguratorParser2025()),
 | |
|             HtmlConfigurator(Path('catalogs/dell/2025-10/20251023 - Cat2 Conf 2-2-03_ DELL Poweredge R660.html'), DellConfiguratorParser2025()),
 | |
|             HtmlConfigurator(Path('catalogs/dell/2025-10/20251020 - Cat2 Conf 2-2-07_ Dell Poweredge R670.html'), DellConfiguratorParser2025()),
 | |
|             HtmlConfigurator(Path('catalogs/dell/2025-10/20251022 - Cat3 Conf 3-2-01 _ Poweredge R760xa.html'), DellConfiguratorParser2025()),
 | |
|             HtmlConfigurator(Path('catalogs/dell/2025-10/20251022 - Cat2 Conf 2-2-09_ Dell Poweredge R6725.html'), DellConfiguratorParser2025()),
 | |
|         ]
 | |
| 
 | |
|         def config_filter(config: Config) -> bool:
 | |
|             # return config.get_price() < 40000.0
 | |
|             # return config.cpu.uid == 'intel-xeon-performance-6505p'  # for debugging
 | |
|             # return config.cpu.uid == 'intel-xeon-performance-6767p'  # for debugging
 | |
|             return True
 | |
| 
 | |
|         figure_file_path = self.plots_dir / '2025-10-dbossion-ais-configs.pdf'
 | |
|         plot_configurators(configurators=configurators, ram_per_core=4.0e9, xaxis_def=ConfigPrice(), yaxis_def=ConfigFlopsPerEuro(), plot_title='physmol/dbossion ais configs', config_filter=config_filter, figure_file_path=figure_file_path)
 | |
| 
 | |
| 
 | |
| if __name__ == '__main__':
 | |
|     unittest.main()
 |