Skip to content
Open
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 requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pymongo
jsonpickle
gunicorn
uvicorn
rocketpy
git+https://github.com/RocketPy-Team/RocketPy.git@develop
uptrace
opentelemetry.instrumentation.fastapi
opentelemetry.instrumentation.requests
Expand Down
2 changes: 1 addition & 1 deletion src/repositories/motor.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ async def read_motor_by_id(self, motor_id: str) -> Optional[MotorModel]:
@repository_exception_handler
async def update_motor_by_id(self, motor_id: str, motor: MotorModel):
await self.update_by_id(
motor.model_dump(exclude_none=True), data_id=motor_id
motor.model_dump(exclude_none=False), data_id=motor_id
Copy link
Collaborator

Choose a reason for hiding this comment

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

why?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Was not able to initialise fields back to null om update

Copy link
Collaborator

Choose a reason for hiding this comment

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

Probably because of some legacy rockets (e.g before drop null was deployed). Could you please test if this is also the case for rockets created after drop null was implemented?

)

@repository_exception_handler
Expand Down
2 changes: 1 addition & 1 deletion src/repositories/rocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ async def read_rocket_by_id(self, rocket_id: str) -> Optional[RocketModel]:
@repository_exception_handler
async def update_rocket_by_id(self, rocket_id: str, rocket: RocketModel):
await self.update_by_id(
rocket.model_dump(exclude_none=True), data_id=rocket_id
rocket.model_dump(exclude_none=False), data_id=rocket_id
)

@repository_exception_handler
Expand Down
8 changes: 5 additions & 3 deletions src/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@ def for_flight(cls) -> 'DiscretizeConfig':


class InfinityEncoder(RocketPyEncoder):
def default(self, o):
obj = o
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)

def default(self, obj):
if (
isinstance(obj, Function)
and not callable(obj.source)
Expand All @@ -73,7 +75,7 @@ def default(self, o):
mutate_self=False,
)
if isinstance(obj, Flight):
obj._Flight__evaluate_post_process()
obj._Flight__evaluate_post_process
solution = np.array(obj.solution)
size = len(solution)
if size > 25:
Expand Down
2 changes: 1 addition & 1 deletion src/views/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class EnvironmentSimulation(ApiBaseView):
initial_east: Optional[float] = None
initial_hemisphere: Optional[str] = None
initial_ew: Optional[str] = None
max_expected_height: Optional[int] = None
max_expected_height: Optional[float] = None
date: Optional[datetime] = Field(default_factory=_default_future_datetime)
local_date: Optional[datetime] = Field(
default_factory=_default_future_datetime
Expand Down
Loading