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

pass a copy of sceneDict to _makeSceneNxR. fixes #502. #503

Merged
merged 9 commits into from
Aug 27, 2024

Conversation

cdeline
Copy link
Contributor

@cdeline cdeline commented Mar 11, 2024

instead of copying some of the keys of sceneDict into a sceneDict2 and passing that to _makeSceneNxR, this updates the appropriate keys, and makes sure that _makeSceneNxR is working from a copy.deepcopy of sceneDict. Because it's a mutable type, this dict was being updated within the makeScene1axis loop. Using a copy here solves that problem.

@cdeline cdeline requested a review from shirubana March 11, 2024 21:58
@cdeline
Copy link
Contributor Author

cdeline commented Mar 11, 2024

@shirubana - I think this quick bug fix is ready to go. Tests are passing aside for the minor delta in coveralls coverage.

@shirubana
Copy link
Member

@cdeline I see you removed removed hub_height from the dictionary. Is it still being saved somewhere?

    # we no longer need sceneDict['hub_height'] - it'll be replaced by 'clearance_height' below
    sceneDict.pop('hub_height',None)

Other htan that I'm okay to merge

@shirubana
Copy link
Member

what happened with this PR? It still has a comment open from my prat above ~

@cdeline
Copy link
Contributor Author

cdeline commented Aug 21, 2024

So, inside makeScene1axis, we start with a hub_height, but that is changed to clearance_height for each timestamp when it is passed to _makeSceneNxR. I could pretty easily add back the hub_height inside _makeSceneNxR if we want it on the sceneDict along with clearance_height - we would just report back both on Scene.SceneDict.

@shirubana
Copy link
Member

Is hub _ height saved somewhere? It 's just for tracker systems to know what the hub height is, not the clearnace height

as a side note, we should round up to 2 decimals. The scene files are ridiculously long.

@cdeline
Copy link
Contributor Author

cdeline commented Aug 22, 2024

Re: 'clearance_height' and 'hub_height': in makeScene1axis, when you pass in 'hub_height', it is converted to a 'clearance_height' and then passed in to _makeSceneNxR. In order to keep warning messages from popping up (from _heightCasesSwitcher if you pass both clearance and hub height), I've removed hub_height from the sceneDict. It sounds like we'd like to have both available in the trackerdict, so I will just add it back onto the sceneDict inside _makeSceneNxR.

@cdeline
Copy link
Contributor Author

cdeline commented Aug 22, 2024

OK, I'll start looking at rounding in places. Let's say to 3 decimals which would be mm accuracy.

@cdeline
Copy link
Contributor Author

cdeline commented Aug 27, 2024

OK, tests are passing, hub_height is back in the sceneDict saved to trackerDict. Filename decimal points reduced. Merging this.

@cdeline cdeline merged commit 3113c1b into main Aug 27, 2024
12 checks passed
@cdeline cdeline deleted the 502_sceneDict_bug branch August 27, 2024 20:28
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