Skip to content

Commit

Permalink
Fixed Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
OscarFdezS committed Jun 27, 2024
1 parent eeeb767 commit d8b4356
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions xdevs/examples/gpt/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ def __init__(self, name: str):
Job event class. It represents a job sent by the generator and processed by the processor.
:param name: job name
"""
self.name: str = name
self.name: str = str(name)
self.time: float = 0
def __str__(self):
return self.name


class Generator(Atomic):
def __init__(self, name: str, gen_t: float):
"""
Expand Down Expand Up @@ -240,7 +241,7 @@ def __init__(self, name: str, gen_t: float, proc_t: float, obs_t: float):
self.add_in_port(self.ih_in)

# New output handler port
self.oh_out = Port(Job, name='ih_in')
self.oh_out = Port(Job, name='oh_out')
self.add_out_port(self.oh_out)

self.add_component(gen)
Expand Down
3 changes: 2 additions & 1 deletion xdevs/plugins/transducers/csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ def bulk_data(self, sim_time: float):
for state_insert in self._iterate_state_inserts(sim_time):
self.state_csv_writer.writerow([state_insert[field] for field in self.state_header])


for event_insert in self._iterate_event_inserts(sim_time):
self.event_csv_writer.writerow([event_insert[field] for field in self.event_header])

Expand All @@ -58,7 +59,7 @@ def _create_csv_file(self, filename: str, header: list[str]):
os.makedirs(os.path.dirname(filename), exist_ok=True)

# 3. Create output CSV file and write the header row.
csv_file = open(filename, 'w')
csv_file = open(filename,newline='', mode='w')
writer = csv.writer(csv_file, delimiter=self.delimiter)
writer.writerow(header)

Expand Down

0 comments on commit d8b4356

Please sign in to comment.