GeezerVison is showing github.com — feature/SOF-8060 Feature: read and write a material's atomic constraints over /api/v1 by VsevolodX · Pull Request #52 · mat3ra/api-client
Conversation
VsevolodX
commented
Nov 4, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Materials are created, updated and read over /api/v1, so a material's atomic constraints are stored with it and come back on read, while list stays on the legacy API because v1 accepts a query selector and silently ignores it (returning the account's first 20 materials instead of the match).
The v1 route files a new material under the login's default account and ignores the account asked for — measured on production: create(config, owner_id=<a non-default account>) returned a material owned by the default one. create therefore compares the owner on the material it reads back and raises, naming the material and both accounts. Teaching MaterialsCreate/MaterialsUpdate to accept accountId is a separate web-app ticket.
Manual checks:
- A material saved with
basis.constraints through client.materials.create comes back from client.materials.get with them (production, seminar)
- A job created on such a material renders the
0 0 0 flags (SOF-8072 fast cell: 100)
- An api-examples notebook using
get_or_create_material / load_material runs unchanged
🤖 Generated with Claude Code
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…creating or updating it
The legacy materials create/update never forward basis.constraints. When a
material carries non-empty constraints, create/update follow the legacy call
with one PUT /api/v1/materials/{id} {accountId, material, constraints}, the
account being the saved material's owner. Without constraints nothing changes.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The v1 route answers failures as HTTP 200 with status 0, so the reply is
read and a rejected write raises. The PUT merges the auth context's current
headers, as BaseEndpoint.request does.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
VsevolodX
added a commit
to mat3ra/api-examples
that referenced
this pull request
Nov 4, 2026
mat3ra-api-client at 0e8752d (SOF-8060, mat3ra/api-client#52) stores
basis.constraints when a material is created or updated. Cell 7.5 updates
each saved material, so a material reused by hash gets the constraints too.
Re-pin to the release when it publishes.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…nts over /api/v1
get, create and update go through a v1 connection built beside the endpoint's
own, so a material's constraints come back in what the client returns; create
and update carry them natively and return the stored material. list and the
set/import/default methods stay on the account-wide version: a v1 list takes
flat filters, not the Mongo selectors every caller sends.
Co-Authored-By: Claude Opus 5 <[email protected]>
…accountId
The v1 route creates and updates under the session's default account and never
reads accountId: measured against production, create(owner_id=<non-default>)
returned a material owned by the default account. create now compares the owner
on the read-back it already does and raises on a mismatch; the field, the
account fallback and update's pre-read are gone.
Co-Authored-By: Claude Opus 5 <[email protected]>
VsevolodX
changed the title
feature/SOF-8060 Feature: store a material's atomic constraints when creating or updating it
feature/SOF-8060 Feature: read and write a material's atomic constraints over /api/v1
Nov 6, 2026
VsevolodX
added a commit
to mat3ra/api-examples
that referenced
this pull request
Nov 6, 2026
mat3ra-api-client at b5f25f7 (SOF-8060, mat3ra/api-client#52) creates, updates
and reads materials over /api/v1, so a saved material's atomic constraints come
back from materials.get instead of only reaching a job's rendered input.
Re-pin to the release when it publishes.
Co-Authored-By: Claude Opus 5 <[email protected]>
|
|
"""
|
|
|
return self._v1_request("GET", "/".join((self.name, id_)))["entity"]
|
|
|
|
|
|
def create(self, config, owner_id=None):
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should there be a separate "create_with_constraints"?
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
@@ -1,5 +1,6 @@ |
|
|
SECURE = True
|
|
|
DEFAULT_API_VERSION = "2018-10-01"
|
|
|
V1_API_VERSION = "v1"
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
At least 1 approving review is required to merge this pull request.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|