MCPcopy Create free account
hub / github.com/mlco2/codecarbon / setUp

Method setUp

tests/output_methods/test_file.py:14–51  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

12
13class TestFileOutput(unittest.TestCase):
14 def setUp(self):
15 self.temp_dir = tempfile.mkdtemp()
16 self.emissions_data = EmissionsData(
17 timestamp="2023-01-01T00:00:00",
18 project_name="test_project",
19 run_id="test_run_id",
20 experiment_id="test_experiment_id",
21 duration=10,
22 emissions=0.5,
23 emissions_rate=0.05,
24 cpu_power=20,
25 gpu_power=30,
26 ram_power=5,
27 cpu_energy=200,
28 gpu_energy=300,
29 ram_energy=50,
30 energy_consumed=550,
31 water_consumed=0.1,
32 country_name="Testland",
33 country_iso_code="TS",
34 region="Test Region",
35 cloud_provider="Test Cloud",
36 cloud_region="test-cloud-1",
37 os="TestOS",
38 python_version="3.8",
39 codecarbon_version="2.0",
40 cpu_count=4,
41 cpu_model="Test CPU",
42 gpu_count=1,
43 gpu_model="Test GPU",
44 longitude=0,
45 latitude=0,
46 ram_total_size=16,
47 tracking_mode="machine",
48 on_cloud="true",
49 pue=1.5,
50 wue=0.5,
51 )
52
53 def tearDown(self):
54 shutil.rmtree(self.temp_dir)

Callers

nothing calls this directly

Calls 1

EmissionsDataClass · 0.90

Tested by

no test coverage detected