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

Re-organize property_database folder to include different files for different property classes #200

Open
tplobo opened this issue May 3, 2023 · 2 comments

Comments

@tplobo
Copy link

tplobo commented May 3, 2023

As a suggestion to open the discussion on how to organize the database, perhaps the property_database folder should include folders for each material, and each these material folders should include files for the different property classes that are expected to be present in the package.
These files should not be a requirement, however, since there might be no references for a particular property class for a given material. Files for treating/analyzing a particular reference (e.g. from WebPlotDigitizer) should be added to their own sub-folder.
A file in the database folder could contain an update_database (__init.py__?) function to automatically add all properties in property_database to the package.
The tree below displays an example structure:

property_database/
├─ alumina/
│  ├─ permeabilities.py
│  ├─ diffusivities.py
│  ├─ solubilities.py
│  ├─ fowler_1977/
│  │  ├─ data.csv
│  │  ├─ project.tar
├─ gold/
│  ├─ diffusivities.py
│  ├─ solubilities.py
├─ iron/
│  ├─ recombinations.py
│  ├─ diffusivities.py
├─ update_database.py

@RemDelaporteMathurin
Copy link
Owner

I thought about this.
I can see the advantage for materials that contain a lot of properties like tungsten.
But some materials only have two or three.

Yes all the subfolders (submodules) need a __init__.py file.
The properties need to be added to htm.database somehow, we have two options, either add it at the level of the file were they were created, or from outside, but in any case, I can't see an "automatic" way of doing this. We have to manually write
Option 1:

from .alumina import my_diffusivity

htm.database.append(my_diffusivity)

Option 2:

my_diffusivity = htm.Diffusivity(........)

htm.database.append(my_diffusivity)

@RemDelaporteMathurin
Copy link
Owner

@tplobo any more thoughts about this?

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

No branches or pull requests

2 participants