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

Update defaults for reading files #86

Merged
merged 6 commits into from
Jan 20, 2025

Conversation

datejada
Copy link
Member

@datejada datejada commented Jan 20, 2025

Changing the default not to skip rows when reading

Related issues

Closes #85

Checklist

  • I am following the contributing guidelines
  • Tests are passing
  • Lint workflow is passing
  • Docs were updated and workflow is passing

@datejada datejada requested a review from suvayu January 20, 2025 13:00
@datejada
Copy link
Member Author

@suvayu This first change is the naive approach: updating the default and, consequently, the files and the tests.

I think you want something more robust, but I'm unsure how to do it. If you give me some hints, I can work on it.

Thanks!

Copy link

codecov bot commented Jan 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 66.91%. Comparing base (48278bb) to head (a736ced).
Report is 6 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #86   +/-   ##
=======================================
  Coverage   66.91%   66.91%           
=======================================
  Files           6        6           
  Lines         266      266           
=======================================
  Hits          178      178           
  Misses         88       88           

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

Copy link
Member

@suvayu suvayu left a comment

Choose a reason for hiding this comment

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

I don't see a better way to do this either.

What I like about it now:

  1. only one (unsurprising) setting, header on/off.
  2. can be easily overridden by passing ;header = false, other = val to any of the create_tbl functions, along with any other options

What I don't like: it lives in an internal pair in that module.

I won't mind it much after this PR because it doesn't do anything surprising. Previously it was by skipping lines. So it was in a way a consequence of an odd choice we made for our data files.

@suvayu
Copy link
Member

suvayu commented Jan 20, 2025

You can actually see the consequence in your PR, removing that skip = 1 made comparing with the CSV.File(...) |> DataFrame a lot simpler.

@suvayu suvayu merged commit ab7be2f into TulipaEnergy:main Jan 20, 2025
6 checks passed
@datejada datejada deleted the 85-update-defaults branch January 20, 2025 16:23
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.

Update defaults in TulipaIO
2 participants