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

Feature/sckan 226 #202

Merged
merged 44 commits into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from 34 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
49de36b
SCKAN-226 feat: Update ingestion script
afonsobspinto Jan 4, 2024
7e18e1f
SCKAN-226 chore: Refactor add_destination to match with add_vias
afonsobspinto Jan 4, 2024
b9ac7f1
SCKAN-226 feat: Enforce reference_uri uniqueness
afonsobspinto Jan 5, 2024
164956a
SCKAN-226 feat: Update ingestion logic
afonsobspinto Jan 5, 2024
68d12ed
SCKAN-226 feat: WIP - Update neurondm script
afonsobspinto Jan 9, 2024
1f5310c
SCKAN-226 feat: WIP - Undo validation neurondm script
afonsobspinto Jan 9, 2024
472c00c
SCKAN-226 feat: Use predicates in partial order processing
afonsobspinto Jan 9, 2024
86508ac
SCKAN-226 feat: Merge vias that differ only on from_entities
afonsobspinto Jan 9, 2024
36eb36e
SCKAN-226 feat: Merge destinations
afonsobspinto Jan 9, 2024
3f1cf31
SCKAN-226 feat: Merge destinations by from_entities
afonsobspinto Jan 9, 2024
a10bced
SCKAN-226 feat: Merge origins
afonsobspinto Jan 9, 2024
7894704
SCKAN-226 feat: Update ingestion script
afonsobspinto Jan 9, 2024
3af6d7a
SCKAN-226 feat: Test both region and layer on entity identification
afonsobspinto Jan 9, 2024
f0e8240
SCKAN-226 feat: Update ingestion script
afonsobspinto Jan 9, 2024
dd76a0c
SCKAN-226 feat: Update default state on ingestion creation
afonsobspinto Jan 9, 2024
066fdd4
SCKAN-226 feat: Add forward connection ingestion
afonsobspinto Jan 9, 2024
3b1c227
SCKAN-226 feat: WIP - Update validation and add logging service
afonsobspinto Jan 12, 2024
79ebe65
SCKAN-226 feat: Make ingestion atomic; Update logging service
afonsobspinto Jan 12, 2024
cb5acc8
SCKAN-226 fix: Update forward connection check
afonsobspinto Jan 12, 2024
65396ec
SCKAN-226 refactor: Use update_or_create instead of custom method
afonsobspinto Jan 12, 2024
5a473a3
SCKAN-226 feat: Add new transition draft to exported for ingestion
afonsobspinto Jan 13, 2024
d29ac5a
SCKAN-226 feat: Remove unnecessary transition
afonsobspinto Jan 17, 2024
5486579
SCKAN-248 fix: Update journey tests
afonsobspinto Jan 17, 2024
8aad5d0
SCKAN-248 feat: Add tests to neurondm processing
afonsobspinto Jan 17, 2024
b7d9d30
SCKAN-248 feat: WIP - Ignore partial order mismatches
afonsobspinto Jan 18, 2024
3620532
Revert "SCKAN-226 feat: Remove unnecessary transition"
afonsobspinto Jan 18, 2024
acbd54b
SCKAN-226 feat: Use .update and .create instead of .update_or_create
afonsobspinto Jan 18, 2024
ecfa9fc
Merge branch 'feature/SCKAN-226' into feature/SCKAN-248
afonsobspinto Jan 18, 2024
0236db4
SCKAN-226 refactor: Use .get_or_create instead of filter
afonsobspinto Jan 22, 2024
fee161f
SCKAN-226 refactor: Remove __exact from filter
afonsobspinto Jan 22, 2024
22219ca
SCKAN-226 refactor: Add has_changes check
afonsobspinto Jan 22, 2024
2872c38
Merge branch 'feature/SCKAN-248' into feature/SCKAN-226
afonsobspinto Jan 24, 2024
8c31f5f
SCKAN-226 feat: Ingest inconsistent populations but flag them with wa…
afonsobspinto Jan 24, 2024
8972398
SCKAN-248 feat: Add invalid state; Update ingestion accordingly
afonsobspinto Jan 30, 2024
e023050
SCKAN-248 feat: Optimize upstream algorithm
afonsobspinto Jan 30, 2024
3223a81
SCKAN-248 chore: Remove TODO annotation
afonsobspinto Jan 30, 2024
09a71fd
SCKAN-248 feat: Add note on step 3 even if state was invalid
afonsobspinto Jan 31, 2024
fba750c
SCKAN-248 feat: Allow transition to invalid from any state
afonsobspinto Jan 31, 2024
cdcedab
SCKAN-248 fix: Update process connection algorithm and jump test
afonsobspinto Jan 31, 2024
9d3729a
SCKAN-248 feat: Update process connection algorithm and multiple axio…
afonsobspinto Feb 1, 2024
75e704b
SCKAN-248 feat: Add partial order vs axioms validation
afonsobspinto Feb 1, 2024
d771152
SCKAN-248 fix: Update has_changes logic
afonsobspinto Feb 1, 2024
35a2a44
SCKAN-248 feat: Update notes
afonsobspinto Feb 1, 2024
513db99
SCKAN-248 feat: Remove deprecated method
afonsobspinto Feb 7, 2024
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
1 change: 1 addition & 0 deletions backend/composer/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class CSState(models.TextChoices):
CONNECTION_MISSING = "connection_missing"
NPO_APPROVED = "npo_approved"
EXPORTED = "exported"
INVALID = "invalid"


class NoteType(models.TextChoices):
Expand Down
10 changes: 9 additions & 1 deletion backend/composer/management/commands/ingest_statements.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,13 @@
class Command(BaseCommand):
help = "Ingests Statements from neurondm pyp package"

def add_arguments(self, parser):
parser.add_argument(
'--update_upstream',
action='store_true',
help='Set this flag to update upstream statements.',
)

def handle(self, *args, **options):
ingest_statements()
update_upstream = options['update_upstream']
ingest_statements(update_upstream)
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by Django 4.1.4 on 2024-01-05 15:46

from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("composer", "0032_alter_connectivitystatement_projection"),
]

operations = [
migrations.AlterField(
model_name="connectivitystatement",
name="reference_uri",
field=models.URLField(blank=True, null=True, unique=True),
),
]
17 changes: 14 additions & 3 deletions backend/composer/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ class ConnectivityStatement(models.Model):
)
apinatomy_model = models.CharField(max_length=200, null=True, blank=True)
additional_information = models.TextField(null=True, blank=True)
reference_uri = models.URLField(null=True, blank=True)
reference_uri = models.URLField(null=True, blank=True, unique=True)
functional_circuit_role = models.ForeignKey(
FunctionalCircuitRole,
on_delete=models.DO_NOTHING,
Expand Down Expand Up @@ -443,6 +443,7 @@ def __str__(self):
CSState.REJECTED,
CSState.NPO_APPROVED,
CSState.EXPORTED,
CSState.INVALID
],
permission=lambda instance, user: ConnectivityStatementService.has_permission_to_transition_to_compose_now(
instance, user
Expand Down Expand Up @@ -500,6 +501,16 @@ def npo_approved(self, *args, **kwargs):
def exported(self, *args, **kwargs):
...

@transition(
field=state,
source=CSState.EXPORTED,
target=CSState.INVALID,
permission=lambda instance, user: ConnectivityStatementService.has_permission_to_transition_to_invalid(
instance, user
), )
def invalid(self, *args, **kwargs):
...

@property
def export_id(self):
return f"CPR:{self.id:06d}"
Expand Down Expand Up @@ -590,7 +601,7 @@ class Destination(AbstractConnectionLayer):
choices=DestinationType.choices,
default=DestinationType.UNKNOWN
)

objects = DestinationManager()

class Meta:
Expand All @@ -604,7 +615,7 @@ class Meta:

class Via(AbstractConnectionLayer):
anatomical_entities = models.ManyToManyField(AnatomicalEntity, blank=True, related_name='via_connection_layers')

objects = ViaManager()

type = models.CharField(
Expand Down
Empty file.
Loading