Skip to content

Refactor gen #31

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Refactor gen #31

wants to merge 1 commit into from

Conversation

plidan123
Copy link
Collaborator

No description provided.

@Desiment Desiment requested a review from Engelsgeduld April 22, 2025 18:58
Copy link
Collaborator

@Engelsgeduld Engelsgeduld left a comment

Choose a reason for hiding this comment

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

Commit messages must follow these rules https://www.conventionalcommits.org/en/v1.0.0/#specification. This makes it easier to understand what you have done.
Message like "Update some_file_name.py" doesn’t convey what was actually changed — that kind of information is already visible in the diff. Message would be:

refactor(api): unify NMM generator interface, replace canonical_generate and classical_generate with generate

@@ -9,7 +9,7 @@
class NMGenerator(AbstractGenerator):

@staticmethod
def classical_generate(mixture: AbstractMixtures, size: int) -> tpg.NDArray:
def generate(mixture: AbstractMixtures, size: int) -> tpg.NDArray:
"""Generate a sample of given size. Classical form of NMM
Copy link
Collaborator

Choose a reason for hiding this comment

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

Change docstrings

@@ -9,7 +9,7 @@
class NMVGenerator(AbstractGenerator):

@staticmethod
def classical_generate(mixture: AbstractMixtures, size: int) -> tpg.NDArray:
def generate(mixture: AbstractMixtures, size: int) -> tpg.NDArray:
"""Generate a sample of given size. Classical form of NMVM
Copy link
Collaborator

Choose a reason for hiding this comment

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

Change docstrings

@@ -9,7 +9,7 @@
class NVGenerator(AbstractGenerator):

@staticmethod
def classical_generate(mixture: AbstractMixtures, size: int) -> tpg.NDArray:
def generate(mixture: AbstractMixtures, size: int) -> tpg.NDArray:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Change docstrings

Update nm_generator.py
Update nmv_generator.py
Update nv_generator.py
Changed NM/NMW/NV generators: if the mixture form is canonical, the beta parameter is not considered in the output.

Update abstract_mixture.py
Remembered parameter for mixture form.

Update test_mixing_normal.py
Update nm_sigma_estimation_comparison.ipynb
Now using the updated generator.
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