Skip to content

Small improvements in primitive routines.#32

Merged
alucantonio merged 9 commits intocpml-au:masterfrom
Smantii:fixes
Feb 23, 2026
Merged

Small improvements in primitive routines.#32
alucantonio merged 9 commits intocpml-au:masterfrom
Smantii:fixes

Conversation

@Smantii
Copy link
Copy Markdown
Member

@Smantii Smantii commented Feb 10, 2026

No description provided.

Copy link
Copy Markdown
Member

@alucantonio alucantonio left a comment

Choose a reason for hiding this comment

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

I have the feeling that we are using dictionaries where we should use classes. For example, "fun_info", "input", "output" could be attributes of an object instead of keys of a dictionary. Also, primal/dual could be part of an enum, so that when you pass the complex to a function like switch_complex, complex is not a string, but an enum with only 2 allowed values.

@Smantii
Copy link
Copy Markdown
Member Author

Smantii commented Feb 11, 2026

Ok, I can try to define a class PrimitiveAttributes, but maybe we should use the class PrimitiveParams in a smarter way?

@alucantonio
Copy link
Copy Markdown
Member

alucantonio commented Feb 11, 2026

I think we need a class called BasePrimitive to replace what is now called PrimitiveParams, and then maybe collect all the attributes that are now part of a dictionary when building primitive variants inside PrimitiveParams. There may be better designs, but right now "PrimitiveParams" is just the description of the base primitive, so the name is not appropriate..

@Smantii
Copy link
Copy Markdown
Member Author

Smantii commented Feb 18, 2026

I think that the best way to handle the code is keeping PrimitiveParams and adding a new class called CochainBaseParams. In every case we use the PrimitiveParams, whereas only for cochains we use some utilities and routines (that I have moved in cochain_primitives.py). Let me know if the new version of the code makes sense now

@alucantonio alucantonio self-requested a review February 23, 2026 08:22
Copy link
Copy Markdown
Member

@alucantonio alucantonio left a comment

Choose a reason for hiding this comment

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

The options for complex, dimension and rank should be part of enums.

@alucantonio alucantonio merged commit 95654d2 into cpml-au:master Feb 23, 2026
1 check passed
@Smantii Smantii deleted the fixes branch February 23, 2026 12:16
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