Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

splitting up job entries into different tables #1009

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 106 additions & 0 deletions docs/uml_diagrams/classes_tables.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
Classes are derived from sqlalchemy.orm class `Base` for common tables or initiated by sqlalchemy class `Table` for m:n relation tables.


```plantuml
@startuml

left to right direction
skinparam ranksep 150

package "sqlalchemy" {
package "orm" {
class Base
}
class Table
}

package "pyiron_contrib" {
class Project {
{static} project_id: Integer
project: String
jobs: sqlalchemy.orm.relationship
}

class User {
{static} user_id: Integer
username: String
jobs: sqlalchemy.orm.relationship
}

class JobStatus {
{static} status_id: Integer
status_name: String
jobs: sqlalchemy.orm.relationship
}

class JobType {
{static} jobtype_id: Integer
jobtype_name: String
typeversion: String
jobs: sqlalchemy.orm.relationship
}

class Queue {
{static} queue_id: Integer
queue_name: String
jobs: sqlalchemy.orm.relationship
}

class Host {
{static} host_id: Integer
host_name: String
jobs: sqlalchemy.orm.relationship
}

class Job {
{static} job_id: Integer
job_name: String
subjob: String
executing_hosts: List
cores: Integer
timestart: datetime
timestop: datetime
totalworkloadtime: Integer
project_id: Integer
user_id: Integer
status_id: Integer
jobtpye_id: Integer
queue_id: Integer
submitting_host_id: Integer
project: sqlalchemy.orm.relationship
users: sqlalchemy.orm.relationship
status: sqlalchemy.orm.relationship
jobtype: sqlalchemy.orm.relationship
queues: sqlalchemy.orm.relationship
submitting_host: sqlalchemy.orm.relationship
metadata_infos: sqlalchemy.orm.relationship
masters: sqlalchemy.orm.relationship
parents: sqlalchemy.orm.relationship
}

class job_metadata {
{static} job_id: Integer
{static} metadata_id: Integer
}

class Metadata{
{static} table_id: Integer
name: String
data: String
jobs: sqlalchemy.orm.relationship
}
}


Base <|-[#blue]- Project
Base <|-[#blue]- User
Base <|-[#blue]- JobStatus
Base <|-[#blue]- JobType
Base <|-[#blue]- Queue
Base <|-[#blue]- Host
Base <|-[#blue]- Job
Base <|-[#blue]- Metadata
Table <|-[#green]- job_metadata

@enduml
```
Binary file added docs/uml_diagrams/classes_tables.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
73 changes: 73 additions & 0 deletions docs/uml_diagrams/db_schema.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
Tables are called `entitis` and tables for implementing m:n relations are `diamonds`.
Generating UML Diagrams with an [PlantUML Editor](https://www.plantuml.mseiche.de/).

```plantuml
@startuml

entity Project {
{static} project_id
project
}

entity User {
{static} user_id
username
}

entity JobStatus {
{static} status_id
status_name
}

entity JobType {
{static} jobtype_id
jobtype_name
typeversion
}

entity Queue {
{static} queue_id
queue_name
}

entity Host {
{static} host_id
host_name
}

entity Job {
{static} job_id
job_name
subjob
executing_hosts
cores
timestart
timestop
totalworkloadtime
project_id
user_id
status_id
jobtpye_id
queue_id
submitting_host_id
}

diamond job_metadata

entity MetadataInfo{
{static} table_id
name
data
}

Project "1" -down- "0..n" Job
Job "0..n" -left- "0..1" JobType
Job "0..n" -right- "1" Host
Job "0..n" -right- "0..1" Queue
Job "0..n" -right- "1" User
Job "0..n" -left- "1" JobStatus
Job "0..m" -down- job_metadata
job_metadata -down- "0..n" MetadataInfo

@enduml
```
Binary file added docs/uml_diagrams/db_schema.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
123 changes: 123 additions & 0 deletions docs/uml_diagrams/handling_incoming_jobdata.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
The handling of incoming jobdata is done by the method `add_jobentry`, which forwards the data to the set and get methods related functions.


```plantuml
@startuml

skinparam ranksep 150

package "pyiron" {
package "pyiron_contrib.tinybase" {
class Project {
{static} project_id
project
jobs
}

class User {
{static} user_id
username
jobs
}

class JobStatus {
{static} status_id
status_name
jobs
}

class JobType {
{static} jobtype_id
jobtype_name
typeversion
jobs
}

class Queue {
{static} queue_id
queue_name
jobs
}

class Host {
{static} host_id
host_name
jobs
}

class Job {
{static} job_id
job_name
subjob
executing_hosts
cores
timestart
timestop
totalworkloadtime
project_id
user_id
status_id
jobtpye_id
queue_id
submitting_host_id
project
users
status
jobtype
queues
submitting_host
metadata_infos
masters
parents
}

class job_metadata {
{static} job_id
{static} metadata_id
}

class Metadata{
{static} table_id
name
data
jobs
}
}
}


circle get_project
circle get_user
circle get_status
circle get_jobtype
circle get_queue
circle get_host
circle add_jobentry
circle set_metadata
circle get_metadata
circle get_job

add_jobentry -[#blue]-> get_project
add_jobentry -[#blue]-> get_user
add_jobentry -[#blue]-> get_status
add_jobentry -[#blue]-> get_jobtype
add_jobentry -[#blue]-> get_queue
add_jobentry -[#blue]-> get_host
add_jobentry -[#blue]-> get_job
add_jobentry -[#blue]-> set_metadata
add_jobentry -[#blue]-> get_metadata

get_project -[#red]-> Project
get_user -[#red]-> User
get_status -[#red]-> JobStatus
get_jobtype -[#red]-> JobType
get_queue -[#red]-> Queue
get_host -[#red]-> Host
get_metadata -[#red]-> Metadata
set_metadata -[#orange]-> Metadata
get_job -[#red]-> Job

job_metadata <-[#violet] Job

@enduml
```
Binary file added docs/uml_diagrams/handling_incoming_jobdata.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading