This repository was archived by the owner on May 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsimcfg.py
More file actions
91 lines (69 loc) · 2.4 KB
/
Copy pathsimcfg.py
File metadata and controls
91 lines (69 loc) · 2.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
"""Internal configuration module for simulation objects
The simulation requires a lot more detailed configuration than
the other processors, so we have two extra objects that require
their own python classes.
"""
class UserAction:
"""Object that stores parameters for a UserAction
Parameters
----------
instance_name : str
Unique name for this particular instance of a UserAction
class_name : str
Name of C++ class that this UserAction should be
"""
def __init__(self, instance_name, class_name):
self.class_name = class_name
self.instance_name = instance_name
def __str__(self):
"""Stringify this UserAction
Returns
-------
str
A human-readable version of this UserAction printing all its attributes
"""
string = "UserAction (" + self.__repr__() + ")\n"
string += " Parameters: \n"
for k, v in self.__dict__.items():
string += " %s : %s \n" % (k, v)
return string
def __repr__(self):
"""A shorter string representation of this UserAction
Returns
-------
str
Just printing its instance and class names
"""
return '%s of class %s' % (self.instance_name, self.class_name)
class PrimaryGenerator:
"""Object that stores parameters for a PrimaryGenerator
Parameters
----------
instance_name : str
Unique name for this particular instance of a PrimaryGenerator
class_name : str
Name of C++ class that this PrimaryGenerator should be
"""
def __init__(self, instance_name, class_name):
self.class_name = class_name
self.instance_name = instance_name
def __str__(self):
"""Stringify this PrimaryGenerator
Returns
-------
str
A human-readable version of this PrimaryGenerator printing all its attributes
"""
string = "PrimaryGenerator (" + self.__repr__() + ")\n"
string += " Parameters: \n"
for k, v in self.__dict__.items():
string += " %s : %s \n" % (k, v)
return string
def __repr__(self):
"""A shorter string representation of this PrimaryGenerator
Returns
-------
str
Just printing its instance and class names
"""
return '%s of class %s' % (self.instance_name, self.class_name)