-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
Repository structure (file layouts, cookiecutter templating engines, distribution options) #1
Comments
So I am not sure how this will go yet, though I learned that However, |
Thanks for summarising this! Don't worry about supporting a lot of things at the start. We can start with a simple structure, one backend ( |
Rather than having a If the data path is set as from dotenv import load_dotenv
load_dotenv()
path_to_data = os.environ["DATA_PATH"] We could add that as one of the default utility functions in the from dotenv import load_dotenv
load_dotenv()
def environ():
return os.environ |
What sorts of data would |
Also, I renamed the project from |
Probably csv or parquet |
I think csv and parquet files would be nice, we would have to use A utility function for them could be something like from pybamm_cookiecutter.util import DataLoader
import pybamm
battery_data = DataLoader.load_data("file1.csv") In other words, as a wrapper over a combination of |
See also: https://learn.scientific-python.org/development/patterns/data-files/. We could adopt |
Adding something else to this roadmap, it would be nice if we could add new models via entry points as well. This requires a few changes in PyBaMM though |
Adding a model via an entry point sounds like a nice idea, but it could be too excessive as well if it isn't done correctly. Do you have a proof-of-concept – I'm not entirely sure how it would go? |
The author would create a model class similar to pybamm's This would solve several existing pain points with adding new models:
With entry points, adding a new model is separate from PyBaMM and authors get to retain ownership but we don't have to endorse the models |
Ah, sounds great – a bootstrapped model should be possible to implement, and IIUC should work similar to how we do parameter sets; though I would like to note that parameter sets are returned as Python dictionaries so it's easier to handle them, here we might have to establish a class that can either parse the AST for a model (or rather just import a JSON-serialised model) to pass it to This issue has been referenced in the GSoC 2024 ideas page for potential readers and contributors, so if and when we flesh out these ideas a bit more, I suggest we should edit and add everything to the top of the thread as well. |
I guess now with the pooch PR merged we could add the default pooch data files path for storing data here as well, which is under |
Adding support for a |
Starting this as a placeholder issue for tracking down tasks to be completed and those that are complete. I will be dividing these into separate issues and PRs
Cookiecutters
as suggested by @Saransh-cpp
Examples
Suggestions from @brosaplanella:
.gitkeep
)Possible layout
The folder structure can look like this
The required documentation should
pyproject.toml
anddocs/conf.py
src/
), unit tests withpyproject.toml
, withwhich can then be accessed as
pybamm.ParameterValues(“MyParameters”)
in the source code.Tracked in #6.
Configuration options
Build-backends
hatch
flit
setuptools
(later)Documentation
Project structure
pyproject.toml
Available licenses (#2)
Addendum 27/02/2024: another thing we would want would be entry points for models in the PyBaMM model structure rather than just parameter sets, please see pybamm-team/PyBaMM#3839 (comment)
The text was updated successfully, but these errors were encountered: