Skip to content
Merged
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
27 changes: 10 additions & 17 deletions petab/v2/C.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,30 +130,23 @@
CONDITION_NAME = "conditionName"
#: Column in the condition table with the ID of an entity that is changed
TARGET_ID = "targetId"
#: Column in the condition table with the type of value that is changed
VALUE_TYPE = "valueType"
#: Column in the condition table with the operation type
OPERATION_TYPE = "operationType"
#: Column in the condition table with the new value of the target entity
TARGET_VALUE = "targetValue"
# value types:
VT_CONSTANT = "constant"
VT_INITIAL = "initial"
VT_RATE = "rate"
VT_ASSIGNMENT = "assignment"
VT_RELATIVE_RATE = "relativeRate"
VT_RELATIVE_ASSIGNMENT = "relativeAssignment"
VALUE_TYPES = [
VT_CONSTANT,
VT_INITIAL,
VT_RATE,
VT_ASSIGNMENT,
VT_RELATIVE_RATE,
VT_RELATIVE_ASSIGNMENT,
# operation types:
OT_CUR_VAL = "setCurrentValue"
OT_NO_CHANGE = "noChange"
Comment on lines +138 to +139
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other constants in C.py are not shortened, so could stick to that "convention". To reduce the length, OT/OPERATION_TYPE could be dropped from the start of the name, since I don't think we have that style elsewhere either.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer introducing prefixes elsewhere than dropping them. I find that this makes it clearer where they belong.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also fine to completely replace them by enums.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll leave it for now, as there is a good chance that "operation types" will be dropped completely


OPERATION_TYPES = [
OT_CUR_VAL,
OT_NO_CHANGE,
]

CONDITION_DF_COLS = [
CONDITION_ID,
TARGET_ID,
VALUE_TYPE,
OPERATION_TYPE,
TARGET_VALUE,
]

Expand Down
Loading