Skip to content

Refactor: Modularized project into src/ layout and integrated pytest-…#2

Open
JoseFelipeFerrada wants to merge 2 commits intoSebastianL18:masterfrom
JoseFelipeFerrada:refactor/src-layout-and-benchmarks
Open

Refactor: Modularized project into src/ layout and integrated pytest-…#2
JoseFelipeFerrada wants to merge 2 commits intoSebastianL18:masterfrom
JoseFelipeFerrada:refactor/src-layout-and-benchmarks

Conversation

@JoseFelipeFerrada
Copy link
Copy Markdown

Hi!

I've been using your library for my master thesis (it's been of great help! c: ) and wanted to make little changes. Mostly use more vectorized calculations from numpy. So i created a PyTest testsuit, added some test of pole retrieval and let the existing test as benchmark of speed and accuracy.

I have been thinking, are the assert i added meaningful? perhaps i should add something more dynamic?

i also added a toml file to make it more like a python library.
Hope it helps :)

imagen

Copy link
Copy Markdown
Owner

@SebastianL18 SebastianL18 left a comment

Choose a reason for hiding this comment

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

Hi.

I am happy that the repository has been helpful for you. Thank you in advance for your ideas and contributions. The benchmark functions and files that you have created are really good, and will significantly improve this repository. I would like to add your contributions to the main branch after some discussion and feedback, because some of the implementations you have created are new for me!

I reviwed your files and leave some comments and suggestions. Additionally, I would be really grateful if you help me writhing a brief explanation about the new tests cases you created, that can be included in the README file.

I will be waiting for reply and feedback!

Best regards!

Sebastian Loaiza

authors = [
{name = "Sebastian Loaiza Elejalde", email = "author@example.com"},
]
dependencies = [
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Missing matplotlib dependency? In fact vecfit3.py imports this lib because it is used to plot fitting results. Probably it is necessary to add matplotlib as another dependency.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

oops, indeed i missed matplotlib suggestion

pyproject.toml Outdated
readme = "README.md"
requires-python = ">=3.8"
authors = [
{name = "Sebastian Loaiza Elejalde", email = "author@example.com"},
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Suggested change
{name = "Sebastian Loaiza Elejalde", email = "author@example.com"},
{name = "Sebastian Loaiza Elejalde", email = "sebloel18@gmail.com"},

pyproject.toml Outdated

[project]
name = "vectfit-python"
version = "0.1.0"
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Suggested change
version = "0.1.0"
version = "1.3.1"

Current version since I wrote the code locally. Just a suggestion

Co-authored-by: Sebastian Loaiza Elejalde <144065519+SebastianL18@users.noreply.github.com>
@JoseFelipeFerrada
Copy link
Copy Markdown
Author

regarding the tests.
we have 3 files, "previous" are the test you had. they now benchmark the speed and the accuracy( via extra arguments) i let them that way because they are usecases, and is useful to measure the speed and improve them

the other two are recover and vector recover
in recover we test the convergence of the 3 asym cases
on vector we test the convergence of vector with equal weight and one with random (i had problem with this case but when creating the test on the new code it passed flawlessly did you fix them? haha)

Performance Benchmarks (test_previous.py): Wraps the original real-world use cases (transformer data, 6x6 admittance matrices, etc.) to benchmark execution time .

Scalar Recovery (test_recover.py): Generates synthetic data from ground-truth transfer functions to verify the algorithm recovers the known terms. Systematically tests asymptote configurations (asymp=1, 2, and 3) with D and E term recovery

Vector Recovery (test_vector_recover.py): Validates correctness in multi-dimensional fitting (4xN). Includes tests with both uniform and randomized weighting arrays to verify the weighting implementation functions correctly.

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