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

Pyelastica API changes #36

Closed
7 tasks done
skim0119 opened this issue Jan 6, 2022 · 6 comments
Closed
7 tasks done

Pyelastica API changes #36

skim0119 opened this issue Jan 6, 2022 · 6 comments
Labels
enhancement New feature or request question Further information is requested
Milestone

Comments

@skim0119
Copy link
Collaborator

skim0119 commented Jan 6, 2022

Issue by armantekinalp
Monday Apr 13, 2020 at 16:07 GMT
Originally opened as https://github.com/GazzolaLab/elastica-python/issues/73


These comments are from @tp5uiuc regarding the API of Elastica. I think they are good comments and we should try to accomplish these changes. @tp5uiuc and @nmnaughton please go over the below list and add your comments. Then after we finalize our discussion, I will start making changes.

Other Refactor Request

-- Dissipation constant name to include mass

@skim0119 skim0119 added enhancement New feature or request question Further information is requested labels Jan 6, 2022
@skim0119
Copy link
Collaborator Author

skim0119 commented Jan 6, 2022

Comment by skim0119
Monday Dec 27, 2021 at 02:16 GMT


If we are going to refactor these, we should do it as soon as possible. To have a smooth transition, we can keep soft-reference link and have deprecated warning. In the version after, we cut-off the reference and throw deprecated error.

  • I think callback name is okay, but maybe it is not common to have one callback for each system(rod).
  • I think the word 'Base' is also fine. I'm seeing many ML python libraries use this convention. Only problem is that it doesn't force users to override the method. If this is needed, we should use abstract from abc.
  • Reducing import statement is good idea, but we should probably make it clear where each modules are coming from, especially in tutorial. I think from elastica import * makes everything very confusing. We should consider using import elastica as el or something.

@nmnaughton
Copy link
Collaborator

I am looking to address the BC issue in #54. Some other thoughts:

  • I agree that there is a better option than wrappers. I don't know if addons or features are the best terminologies though. Maybe 'functionalities'? (I don't really like that either though). tbd...
  • I like changing callback to something else too. What about logging? For non-programmers, that might be a bit more intuitive. Also, we could use 'Default' instead of 'Base' to address @skim0119's point about the overriding issue.
  • I also agree about the import statement issue, there should be a cleaner approach. import elastica as *** seems more consistent with norms. el works, but maybe there is a better contraction?

@skim0119
Copy link
Collaborator Author

skim0119 commented Feb 8, 2022

  • Since we are using the composition concept to model the simulator, Wrapper to Component is also a good candidate. To be explicit, we can rename the directory simulator and use the work component in the code and descriptions.
  • I think callback is a pretty common word for a functionality that is a little different than logging. I think logging should be one type of callback (although it is only type we have implemented 😆 ). For example, we might want to have a callback that explicitly checks for nan in each step.
  • We can start using import elastica as *** as a new convention when writing documentation. Nothing is set on stone, but in elastica++ I use
namespace efo = ::elastica::forcing;
namespace eco = ::elastica::constraints;
namespace econ = ::elastica::connections;

@nmnaughton
Copy link
Collaborator

  • I like Simulator and Component! The idea that you need to add the needed components to your simulator should be pretty intuitive to users.
  • Good point about the callback concept. I do think maybe a default 'logging' callback could be useful for users who just want to get that functionality quickly, but you are right, we should allow those other extensions without limiting things. Maybe have CallBackBaseClass and also provide a DefaultLogger that is derived from it?

@skim0119
Copy link
Collaborator Author

I refactored the class OneEndFixedRod to OneEndFixedBC in wip_constraint branch. I left a deprecation warning message and alias. The alias will be removed in v0.3.0

@bhosale2
Copy link
Collaborator

Closed since completed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants