SimplyCommon API Reference
database
SimulationTable
Bases: SQLModel
The table in the database for a simulation item. Name is Optional as we don't have to name each runs. This table is linked to the artifact table. Each runs has its own artefact table.
Source code in simplycommon/database.py
117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | |
check_hashes_exists(input_hash, engine)
Returns the path and hash of a artifact if it already exists is the db to save space.
Source code in simplycommon/database.py
456 457 458 459 460 461 462 463 464 465 466 | |
sim_to_db(run, session)
Dump a simulation item into the simply database.
Source code in simplycommon/database.py
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 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | |
sims_to_db(simulations, session)
Dump an entire sim_dict to the database.
Source code in simplycommon/database.py
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 | |
misc
Context
A runtime object is a condensed of metadata to give an overview of a run.
Source code in simplycommon/misc.py
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | |
simulation
Simulation
Source code in simplycommon/simulation.py
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 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 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 | |
log_result(name, value_dict)
The save a result command can work in a few different ways. First the api provides two ways of saving result. Either applying result(obj, id=None) on one single result. It will log in the database the entry with its artifact it should point to and save the result by default in the hdfs5 blob. On the other hand the command addResult(result, id=None, path=None, save_result=False) allow more flexibility to the user. Alowing to copy artefic once save by the user, only log file in the db without copying or saving a dic of result in the hdfs matrix.
However this functions needs to be tested in the case of saving a large quantity of data (Future problems)
Note that for now this function need the environment handler and the project manager. They should be created per project and handle as globar variables accessed by each object simulation to manipulate the .simply dir. In short, this function cannot work and be tested yet.
You cannot find path to be none and save_result to be false at the same time.
Source code in simplycommon/simulation.py
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 | |