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

Trajectory serializer #844

Closed
wants to merge 5 commits into from
Closed
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
2 changes: 1 addition & 1 deletion alyx/alyx/settings_lab_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# ALYX-SPECIFIC
ALLOWED_HOSTS = ['localhost', '127.0.0.1']
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'GB'
TIME_ZONE = 'Europe/London'
GLOBUS_CLIENT_ID = '525cc543-8ccb-4d11-8036-af332da5eafd'
SUBJECT_REQUEST_EMAIL_FROM = '[email protected]'
DEFAULT_SOURCE = 'IBL'
Expand Down
23 changes: 23 additions & 0 deletions alyx/data/migrations/0020_alter_datarepository_timezone.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 5.0 on 2024-03-26 15:27

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("data", "0019_dataset_qc"),
]

operations = [
migrations.AlterField(
model_name="datarepository",
name="timezone",
field=models.CharField(
blank=True,
default="Europe/London",
help_text="Timezone of the server (see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)",
max_length=64,
),
),
]
9 changes: 0 additions & 9 deletions alyx/experiments/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,6 @@ class TrajectoryEstimateSerializer(serializers.ModelSerializer):
queryset=CoordinateSystem.objects.all(),
)

def to_internal_value(self, data):
if data.get('chronic_insertion', None) is None:
data['chronic_insertion'] = None

if data.get('probe_insertion', None) is None:
data['probe_insertion'] = None

return super(TrajectoryEstimateSerializer, self).to_internal_value(data)

class Meta:
model = TrajectoryEstimate
fields = '__all__'
Expand Down
3 changes: 3 additions & 0 deletions alyx/experiments/tests_rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ def test_create_list_delete_trajectory(self):
# create a trajectory
url = reverse('trajectoryestimate-list')
tdict = {'probe_insertion': alyx_insertion['id'],
'chronic_insertion': None,
'x': -4521.2,
'y': 2415.0,
'z': 0,
Expand Down Expand Up @@ -216,6 +217,7 @@ def test_create_list_delete_channels(self):
# create the probe insertion
pi = self.ar(self.post(reverse('probeinsertion-list'), self.dict_insertion), 201)
tdict = {'probe_insertion': pi['id'],
'chronic_insertion': None,
'x': -4521.2,
'y': 2415.0,
'z': 0,
Expand Down Expand Up @@ -273,6 +275,7 @@ def test_chronic_insertion(self):

# create a trajectory and attach it to the chronic insertion
traj_dict = {'chronic_insertion': ci['id'],
'probe_insertion': None,
'x': -4521.2,
'y': 2415.0,
'z': 0,
Expand Down
23 changes: 23 additions & 0 deletions alyx/misc/migrations/0010_alter_lab_timezone.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 5.0 on 2024-03-26 15:27

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("misc", "0009_auto_20211122_1535"),
]

operations = [
migrations.AlterField(
model_name="lab",
name="timezone",
field=models.CharField(
blank=True,
default="Europe/London",
help_text="Timezone of the server (see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)",
max_length=64,
),
),
]
4 changes: 2 additions & 2 deletions requirements_frozen.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
asgiref==3.8.1
backports.zoneinfo==0.2.1
boto3==1.34.69
botocore==1.34.69
boto3==1.34.70
botocore==1.34.70
certifi==2024.2.2
cffi==1.16.0
charset-normalizer==3.3.2
Expand Down
Loading