Skip to content

[Draft] Revert overrides#177

Draft
Raytesnel wants to merge 9 commits intomainfrom
revert-overrides
Draft

[Draft] Revert overrides#177
Raytesnel wants to merge 9 commits intomainfrom
revert-overrides

Conversation

@Raytesnel
Copy link
Copy Markdown
Collaborator

@Raytesnel Raytesnel commented Mar 10, 2026

PoC of how to multipart requests, team up with @cfs-data

what i have learned so far:

  • formdata is used as a flat dictionary. so pydantic inherentance is not working nicely here.
  • mixing dataclasses with pydantic models is also not helping. (striation/impression parameters dataclass)
  • when having only Form() in the input as pydantic model, and the FileUpload / File() in the same pydantic model looks like resolving the openAPI render issue. (see image) this will put it as parameters as a Form(). so far looking good.
image

to investigate

  • works bytes also instead of UploadFile
  • how to handle the not flat pydantic models -> doesnt work
    Value error, chamber impression mark is not a striation mark [type=value_error, input_value=<MarkType.CHAMBER_IMPRESS...hamber impression mark'>, input_type=MarkType]` -> split it up with 2 different enums to make it explicit what to use in endpoint.

the other stuff works

what to do:

  • fix the flattness of the schemas
  • fix test contracts.py (and other random tests)
  • update enum Marktype to different types
  • fix bounding_box_list schema defaults
  • update swagger that all values has descriptions

Comment thread src/preprocessors/schemas.py Outdated
lowpass_cutoff: float | None = 5.0e-6
highpass_regression_order: int = 2
lowpass_regression_order: int = 0
mask_data: UploadFile = File()
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Since the mask should fit in memory, use bytes here as typing instead of UploadFile to avoid the file system spooling in starlette

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

(also in the other places)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

yhea i changed it so it follows more the repo of my old project. (and it works till now) later if we fixed the last issue we can trim one for one till it bytes again i think

@Raytesnel Raytesnel marked this pull request as ready for review March 31, 2026 09:21
@github-actions
Copy link
Copy Markdown

Diff Coverage

Diff: origin/main..HEAD, staged and unstaged changes

  • packages/scratch-core/src/conversion/preprocess_impression/preprocess_impression.py (100%)
  • packages/scratch-core/src/conversion/preprocess_striation/pipeline.py (100%)
  • src/models.py (100%)
  • src/preprocessors/controller.py (100%)
  • src/preprocessors/router.py (100%)
  • src/preprocessors/schemas.py (100%)
  • src/schemas.py (100%)

Summary

  • Total: 80 lines
  • Missing: 0 lines
  • Coverage: 100%

@github-actions
Copy link
Copy Markdown

Code Coverage

Package Line Rate Branch Rate Health
. 96% 93%
computations 85% 50%
container_models 99% 100%
conversion 96% 89%
conversion.export 100% 100%
conversion.filter 97% 89%
conversion.leveling 100% 100%
conversion.leveling.solver 100% 75%
conversion.plots 99% 88%
conversion.preprocess_impression 86% 76%
conversion.preprocess_striation 90% 62%
conversion.profile_correlator 96% 82%
conversion.surface_comparison 99% 89%
conversion.surface_comparison.cell_registration 100% 90%
extractors 97% 75%
mutations 100% 100%
parsers 97% 50%
parsers.patches 89% 60%
preprocessors 99% 88%
processors 100% 83%
renders 99% 50%
utils 71% 100%
Summary 97% (3260 / 3357) 85% (331 / 390)

Minimum allowed line rate is 50%

@cfs-data cfs-data changed the title Revert overrides [Draft] Revert overrides Apr 1, 2026
@cfs-data cfs-data marked this pull request as draft April 1, 2026 08:21
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.

2 participants