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

Mesh1D vertices to accept list #665

Merged
merged 18 commits into from
Dec 13, 2023

Conversation

JonathanGSDUFOUR
Copy link
Contributor

@JonathanGSDUFOUR JonathanGSDUFOUR commented Dec 11, 2023

Proposed changes

Added a setter for the vertices in Mesh_1D so that a list in input is converted to ndarray, the correct format.
There is also an added test to check if the format of the vertices is still good.

Types of changes

What types of changes does your code introduce to FESTIM?

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Code refactoring
  • Documentation Update (if none of the other choices apply)
  • New tests

Checklist

  • Black formatted
  • Unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...

@JonathanGSDUFOUR JonathanGSDUFOUR marked this pull request as ready for review December 11, 2023 14:15
@jhdark jhdark self-requested a review December 11, 2023 14:16
Copy link

codecov bot commented Dec 11, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (71039f3) 98.87% compared to head (f8b8461) 99.07%.
Report is 71 commits behind head on fenicsx.

❗ Current head f8b8461 differs from pull request most recent head 0d279c6. Consider uploading reports for the commit 0d279c6 to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##           fenicsx     #665      +/-   ##
===========================================
+ Coverage    98.87%   99.07%   +0.19%     
===========================================
  Files           23       24       +1     
  Lines          974     1076     +102     
===========================================
+ Hits           963     1066     +103     
+ Misses          11       10       -1     

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

@jhdark jhdark changed the title new vertices setter Mesh1D vertices to accept list Dec 11, 2023
Copy link
Collaborator

@jhdark jhdark left a comment

Choose a reason for hiding this comment

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

Just some small changes to make

test/test_mesh.py Outdated Show resolved Hide resolved
Copy link
Collaborator

Choose a reason for hiding this comment

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

You can update the documentation too

@jhdark jhdark added fenicsx Issue that is related to the fenicsx support enhancement New feature or request labels Dec 11, 2023
@jhdark
Copy link
Collaborator

jhdark commented Dec 11, 2023

Thanks Jonathon for your first contribution to festim !!! Hopefully the first of many! Any other changes from you @RemDelaporteMathurin

Copy link
Collaborator

@RemDelaporteMathurin RemDelaporteMathurin left a comment

Choose a reason for hiding this comment

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

Hi @JonathanGSDUFOUR! Congrats for this first contribution! 🎉

A couple of comments on my side.

Also the coverage doesn't seem to be uploaded to Codecov.

@jhdark we may have to update the uploader in the github actions workflow.

festim/mesh/mesh_1d.py Outdated Show resolved Hide resolved
festim/mesh/mesh_1d.py Outdated Show resolved Hide resolved
festim/mesh/mesh_1d.py Outdated Show resolved Hide resolved
test/test_mesh.py Outdated Show resolved Hide resolved
test/test_mesh.py Outdated Show resolved Hide resolved
@RemDelaporteMathurin RemDelaporteMathurin linked an issue Dec 12, 2023 that may be closed by this pull request
@RemDelaporteMathurin
Copy link
Collaborator

@JonathanGSDUFOUR here's a tip to format your scripts.

Install black

pip install black

Then run:

black .

This will format all the files in the current directory.

Alternatively you can also install the black extension in Visual Studio Code (if you're using it)

@RemDelaporteMathurin
Copy link
Collaborator

@JonathanGSDUFOUR right I don't know why the linting is not passing... Maybe different versions of black? the workflow runs with black 23.12.0, what is your black version?

@JonathanGSDUFOUR
Copy link
Contributor Author

When I managed to use black it was through pip install black in terminal, but it uses the 19.10b0 version, and when trying to use VSCode extension it doesn't seem to work (the extension is on version 23.10.1)

@RemDelaporteMathurin
Copy link
Collaborator

This is a very old version of black (2019!!)

Can you try to upgrade it with

pip install -U black

Copy link
Collaborator

@RemDelaporteMathurin RemDelaporteMathurin left a comment

Choose a reason for hiding this comment

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

This looks good to me! Thanks @JonathanGSDUFOUR and congrats on your first contribution! 💯

@jhdark feel free to merge this

@jhdark jhdark merged commit b7aca0d into festim-dev:fenicsx Dec 13, 2023
5 checks passed
@JonathanGSDUFOUR JonathanGSDUFOUR deleted the mesh_values_as_vertices branch April 4, 2024 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request fenicsx Issue that is related to the fenicsx support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mesh Vertices should accept a list
3 participants