Skip to content

Improving location support - #2001

Closed
OMWalmsley wants to merge 2 commits into
datalab-org:ml-evs/bump-pydantic-final-finalfrom
OMWalmsley:OMWalmsley/location-route-and-location-trait
Closed

Improving location support#2001
OMWalmsley wants to merge 2 commits into
datalab-org:ml-evs/bump-pydantic-final-finalfrom
OMWalmsley:OMWalmsley/location-route-and-location-trait

Conversation

@OMWalmsley

Copy link
Copy Markdown
Contributor

Resolves #1970

Locations are where things are stored. Currently we are using a single string in the database to store the location and then frontend application logic on top to create a nested hierarchy. Moving forward it would be ideal to move some of this logic to the backend to prevent locations being generated from stale/deprecated data that has been stored in the frontend.

Features

  • Introduces GET \locations endpoint.
    • Which returns a flat list of all locations and a nested list of all locations.
  • Introduces HasLocation attribute for all items

Example

An example return from the endpoint is here
{"flat_locations":["Hub1 > Hub2 > Place 1","LHud One","Lab 1 > Shelf 1 > Place A","Lab 4 > Shelf 1","lab1"],"nested_locations":{"Hub1":{"Hub2":{"Place 1":{}}},"LHud One":{},"Lab 1":{"Shelf 1":{"Place A":{}}},"Lab 4":{"Shelf 1":{}},"lab1":{}}}

Testing

Currently three tests have been written to test this endpoint functionality (GET \locations).

Further planned functionality

Implement this into the frontend so that it queries this endpoint instead of using frontend storage.

@OMWalmsley OMWalmsley self-assigned this Aug 11, 2026
@codecov

codecov Bot commented Aug 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.06%. Comparing base (6d809c7) to head (c029337).

Additional details and impacted files
@@                         Coverage Diff                          @@
##           ml-evs/bump-pydantic-final-final    #2001      +/-   ##
====================================================================
+ Coverage                             80.02%   80.06%   +0.03%     
====================================================================
  Files                                    83       83              
  Lines                                  7626     7641      +15     
====================================================================
+ Hits                                   6103     6118      +15     
  Misses                                 1523     1523              
Files with missing lines Coverage Δ
pydatalab/src/pydatalab/models/equipment.py 100.00% <ø> (ø)
pydatalab/src/pydatalab/models/items.py 96.96% <100.00%> (ø)
...datalab/src/pydatalab/models/starting_materials.py 100.00% <100.00%> (ø)
pydatalab/src/pydatalab/models/traits.py 99.04% <100.00%> (+0.02%) ⬆️
pydatalab/src/pydatalab/routes/v0_1/items.py 84.55% <100.00%> (+0.32%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@OMWalmsley
OMWalmsley force-pushed the OMWalmsley/location-route-and-location-trait branch from 82cff67 to c029337 Compare August 12, 2026 09:03
@OMWalmsley

Copy link
Copy Markdown
Contributor Author

This PR has been superseeded by #2002

@OMWalmsley OMWalmsley closed this Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant