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

Add csv reader #13

Merged
merged 19 commits into from
Jan 8, 2025
Merged

Add csv reader #13

merged 19 commits into from
Jan 8, 2025

Conversation

LukeFiddy
Copy link
Collaborator

added script to read csv files
added tests for this script
also pulled together scripts in main to run the program.

Copy link

codecov bot commented Dec 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (d4df5f0) to head (7291758).
Report is 20 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #13   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            3         4    +1     
  Lines           25        62   +37     
=========================================
+ Hits            25        62   +37     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Luke Fiddy and others added 3 commits December 17, 2024 13:46
* initial changes to refactor to typer

* fix cli test for typer

* add mocking for calculate_optimal_voltages function

* added unitest to pyproject.toml

* added typer to pyproject.toml

* remove pytest from pyproject.toml

* add typer cli test

* add mocking and fixtures to tests

* add type ignore flag to pandas object

* fix indentation

* add stdout assertion to test_app

* combine the two tests
add assertion for passed arguments
rename mock object

* add assertion for increment arg

* change entrypoint from main to app

* add parametrize to test cli with and without output_path arg

* remove print statement

* fix bug, change underscore to hyphen

* fix unbound error on runner result

---------

Co-authored-by: Luke Fiddy <[email protected]>
Co-authored-by: root <[email protected]>
Copy link
Collaborator

@dan-fernandes dan-fernandes left a comment

Choose a reason for hiding this comment

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

Very minor changes, otherwise looks great

tests/data/raw_data.csv Outdated Show resolved Hide resolved
with patch("bimorph_mirror_analysis.read_file.pd.read_csv") as mock_read_csv:
mock_read_csv.return_value = raw_data
pivoted, initial_voltages, increment = read_bluesky_plan_output("input_path")
# expected_output = pd.read_csv(output_path) # type: ignore
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could: Delete comment

@LukeFiddy LukeFiddy merged commit d6e76f6 into main Jan 8, 2025
13 checks passed
@LukeFiddy LukeFiddy deleted the add_csv_reader branch January 8, 2025 14:46
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