archan ¤
Archan package.
The purpose of this package is to make possible the analysis of a problem using a DSM (Design Structure Matrix) on which certain criteria will be verified.
Modules:
-
analysis
–Analysis module.
-
cli
–Module that contains the command line application.
-
config
–Configuration module.
-
debug
–Debugging utilities.
-
dsm
–DSM module.
-
enums
–Enumerations module.
-
errors
–Errors module.
-
logging
–Logging module.
-
plugins
–Plugins submodule.
-
printing
–Printing module.
Classes:
-
Argument
–Placeholder for name, class, description and default value.
-
Checker
–Checker class.
-
DesignStructureMatrix
–Design Structure Matrix class.
-
DomainMappingMatrix
–Domain Mapping Matrix class.
-
Logger
–Static class to store loggers.
-
MultipleDomainMatrix
–Multiple Domain Matrix class.
-
Provider
–Provider class.
Argument ¤
Bases: PrintableArgumentMixin
Placeholder for name, class, description and default value.
Parameters:
-
name
(str
) –Name of the argument.
-
cls
(type
) –Type of the argument.
-
description
(str
) –Description of the argument.
-
default
(Any | None
, default:None
) –Default value for the argument.
Methods:
-
print
–Print self with optional indent.
Source code in src/archan/plugins/__init__.py
21 22 23 24 25 26 27 28 29 30 31 32 33 |
|
print ¤
print(indent: int = 0) -> None
Print self with optional indent.
Parameters:
-
indent
(int
, default:0
) –Indentation.
Source code in src/archan/printing.py
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
|
Checker ¤
Checker(
name: str | None = None,
description: str | None = None,
hint: str | None = None,
allow_failure: bool = False,
passes: Any | None = None,
arguments: dict | None = None,
)
Bases: PrintableNameMixin
, PrintablePluginMixin
Checker class.
An instance of Checker implements a check method that analyzes an instance of DSM/DMM/MDM and return a true or false value, with optional message.
Parameters:
-
name
(str | None
, default:None
) –The checker name.
-
description
(str | None
, default:None
) –The checker description.
-
hint
(str | None
, default:None
) –Hint provided for failures.
-
allow_failure
(bool
, default:False
) –Still pass if failed or not.
-
passes
(Any | None
, default:None
) –Boolean.
-
arguments
(dict | None
, default:None
) –Arguments passed to the check method when run.
Methods:
-
check
–Check the data and return a result.
-
print
–Print self.
-
print_name
–Print name with optional indent and end.
-
run
–Run the check method and format the result for analysis.
Source code in src/archan/plugins/__init__.py
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 |
|
check ¤
check(
dsm: DesignStructureMatrix
| MultipleDomainMatrix
| DomainMappingMatrix,
**kwargs: Any
) -> tuple[Any, str]
Check the data and return a result.
Parameters:
-
dsm
(DesignStructureMatrix | MultipleDomainMatrix | DomainMappingMatrix
) –DSM/DMM/MDM instance to check.
-
**kwargs
(Any
, default:{}
) –Additional arguments.
Returns:
-
result
(Any
) –Checker constant or object with a
__bool__
method. -
message
(str
) –Optional messages.
Source code in src/archan/plugins/__init__.py
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
|
print ¤
print() -> None
Print self.
Source code in src/archan/printing.py
115 116 117 118 119 120 121 122 123 124 125 126 |
|
print_name ¤
Print name with optional indent and end.
Parameters:
Source code in src/archan/printing.py
73 74 75 76 77 78 79 80 |
|
run ¤
run(
data: DesignStructureMatrix
| MultipleDomainMatrix
| DomainMappingMatrix,
) -> None
Run the check method and format the result for analysis.
Parameters:
-
data
(DesignStructureMatrix | MultipleDomainMatrix | DomainMappingMatrix
) –DSM/DMM/MDM instance to check.
Source code in src/archan/plugins/__init__.py
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 |
|
DesignStructureMatrix ¤
DesignStructureMatrix(
data: list[list[int | float]],
entities: list | None = None,
categories: list | None = None,
)
Bases: BaseMatrix
Design Structure Matrix class.
Parameters:
-
data
(list[list[int | float]]
) –2-dim array.
-
entities
(list | None
, default:None
) –List of entities.
-
categories
(list | None
, default:None
) –List of the categories (one per entity).
Methods:
-
default_entities
–Default entities used when there are none.
-
transitive_closure
–Compute the transitive closure of the matrix.
-
validate
–Base validation + entities = rows.
Attributes:
-
columns
(int
) –Return number of columns in data.
-
rows
(int
) –Return number of rows in data.
-
size
(tuple[int, int]
) –Return number of rows and columns in data.
Source code in src/archan/dsm.py
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
|
size property
¤
default_entities ¤
Default entities used when there are none.
Returns:
Source code in src/archan/dsm.py
141 142 143 144 145 146 147 |
|
transitive_closure ¤
Compute the transitive closure of the matrix.
Returns:
Source code in src/archan/dsm.py
167 168 169 170 171 172 173 174 175 176 177 178 179 |
|
validate ¤
validate() -> None
Base validation + entities = rows.
Raises:
-
DesignStructureMatrixError
–When number of entities is different than number of rows.
Source code in src/archan/dsm.py
156 157 158 159 160 161 162 163 164 165 |
|
DomainMappingMatrix ¤
DomainMappingMatrix(
data: list[list[int | float]],
entities: list | None = None,
categories: list | None = None,
)
Bases: BaseMatrix
Domain Mapping Matrix class.
Parameters:
-
data
(list[list[int | float]]
) –2-dim array.
-
entities
(list | None
, default:None
) –List of entities.
-
categories
(list | None
, default:None
) –List of the categories (one per entity).
Methods:
-
default_entities
–Return range from 0 to rows + columns.
-
validate
–Base validation + entities = rows + columns.
Attributes:
-
columns
(int
) –Return number of columns in data.
-
rows
(int
) –Return number of rows in data.
-
size
(tuple[int, int]
) –Return number of rows and columns in data.
Source code in src/archan/dsm.py
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
|
size property
¤
default_entities ¤
Return range from 0 to rows + columns.
Returns:
Source code in src/archan/dsm.py
201 202 203 204 205 206 207 |
|
validate ¤
validate() -> None
Base validation + entities = rows + columns.
Raises:
-
DomainMappingMatrixError
–When number of entities is different than rows plus columns.
Source code in src/archan/dsm.py
187 188 189 190 191 192 193 194 195 196 197 198 199 |
|
Logger ¤
Static class to store loggers.
Methods:
-
get_logger
–Return a logger.
-
set_level
–Set level of logging for all loggers.
get_logger staticmethod
¤
Return a logger.
Parameters:
-
name
(str
) –Name to pass to the logging module.
-
level
(int | None
, default:None
) –Level of logging.
-
fmt
(str
, default:':%(lineno)d: %(message)s'
) –Format string.
Returns:
-
Logger
–Logger from
logging.getLogger
.
Source code in src/archan/logging.py
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 |
|
set_level staticmethod
¤
set_level(level: int) -> None
Set level of logging for all loggers.
Parameters:
-
level
(int
) –Level of logging.
Source code in src/archan/logging.py
17 18 19 20 21 22 23 24 25 26 |
|
MultipleDomainMatrix ¤
MultipleDomainMatrix(
data: list[list[int | float]],
entities: list | None = None,
categories: list | None = None,
)
Bases: BaseMatrix
Multiple Domain Matrix class.
Parameters:
-
data
(list[list[int | float]]
) –2-dim array.
-
entities
(list | None
, default:None
) –List of entities.
-
categories
(list | None
, default:None
) –List of the categories (one per entity).
Methods:
-
default_entities
–Default entities used when there are none.
-
validate
–Base validation + each cell is instance of DSM or MDM.
Attributes:
-
columns
(int
) –Return number of columns in data.
-
rows
(int
) –Return number of rows in data.
-
size
(tuple[int, int]
) –Return number of rows and columns in data.
Source code in src/archan/dsm.py
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
|
size property
¤
default_entities ¤
Default entities used when there are none.
Returns:
Source code in src/archan/dsm.py
141 142 143 144 145 146 147 |
|
validate ¤
validate() -> None
Base validation + each cell is instance of DSM or MDM.
Raises:
-
MultipleDomainMatrixError
–When diagonal cells are not DSM nor MDM, or when other cells are not DMM nor MDM.
Source code in src/archan/dsm.py
216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 |
|
Provider ¤
Bases: PrintableNameMixin
, PrintablePluginMixin
Provider class.
An instance of provider implements a get_data method that returns an instance of DSM/DMM/MDM to be checked by an instance of Checker.
Parameters:
-
name
(str | None
, default:None
) –The provider name.
-
description
(str | None
, default:None
) –The provider description.
-
arguments
(dict | None
, default:None
) –Arguments that will be used for
get_data
method.
Methods:
-
get_data
–Abstract method. Return instance of DSM/DMM/MDM.
-
print
–Print self.
-
print_name
–Print name with optional indent and end.
-
run
–Run the get_data method with run arguments, store the result.
Source code in src/archan/plugins/__init__.py
149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 |
|
get_data ¤
Abstract method. Return instance of DSM/DMM/MDM.
Parameters:
-
**kwargs
(Any
, default:{}
) –Keyword arguments.
Raises:
-
NotImplementedError
–This method must be implemented in subclasses.
Source code in src/archan/plugins/__init__.py
170 171 172 173 174 175 176 177 178 179 |
|
print ¤
print() -> None
Print self.
Source code in src/archan/printing.py
115 116 117 118 119 120 121 122 123 124 125 126 |
|
print_name ¤
Print name with optional indent and end.
Parameters:
Source code in src/archan/printing.py
73 74 75 76 77 78 79 80 |
|
run ¤
run() -> None
Run the get_data method with run arguments, store the result.
Source code in src/archan/plugins/__init__.py
181 182 183 |
|