Initial commit of magma's mascgen algorithm in Python#18
Draft
Yashvi-Sharma wants to merge 1 commit intomainfrom
Draft
Initial commit of magma's mascgen algorithm in Python#18Yashvi-Sharma wants to merge 1 commit intomainfrom
Yashvi-Sharma wants to merge 1 commit intomainfrom
Conversation
prkrtg
reviewed
Sep 16, 2025
Contributor
There was a problem hiding this comment.
Dunno if we use this license or a different one?
Either case it shouldn't live here, the license lives in top level of the repo
Contributor
There was a problem hiding this comment.
Can we convert the Jupiter notebook into a test file with test cases?
Contributor
There was a problem hiding this comment.
No toml at this level, can you move the toml to the top level of lris2 project?
| sel = (ydivrow >= 0) & (ydivrow_floor < csuparams.num_bar_pairs) & (ydivrow > ydivrow_floor + fac2) & (ydivrow < ydivrow_floor + fac1 + fac2) | ||
| self.data.loc[sel, 'obj_rr'] = ydivrow_floor[sel].astype(int) | ||
|
|
||
| # def set_overlap_row(self, buffer, csuparams): |
Contributor
There was a problem hiding this comment.
Do we need this code since it is commented out?
| if j < 0: | ||
| break | ||
| # If there is a best node in the conflicting row, compare scores | ||
| prev_total = self.bestNodes[j].total_score() |
| config = yaml.safe_load(file) | ||
| return config | ||
|
|
||
| def get_args(): |
Contributor
There was a problem hiding this comment.
I would keep this separate from the algorithm itself
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Added lris2-mascgen/. The main code is in lris2-mascgen/lris2_mascgen/. The script magma_algorithm.py contains the optimization routine, utils.py contain some helper functions, slit.py is from the older version of Magma Mascgen code and it might be obsolete but I committed it for now.
lris2-mascgen/config.yaml contains CSU specific parameters that magma_algorithm.py uses.
lris2-mascgen/example.ipynb contains an example of how to run magma_algorithm.py.