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

Warn when extrapolating get_permeability_data #27

Open
driftregion opened this issue Jan 9, 2025 · 0 comments
Open

Warn when extrapolating get_permeability_data #27

driftregion opened this issue Jan 9, 2025 · 0 comments

Comments

@driftregion
Copy link

Is your feature request related to a problem? Please describe.

When calling get_permeability_data as shown below, it is possible to pass temperature and frequency values that are outside of the range of the source data, like temperature=-20, frequency=1e12 and get results back without triggering a warning.

import materialdatabase as mdb
db = mdb.MaterialDatabase()
db.get_permeability_data(
    temperature=25,
    frequency=1e5,
    material_name=mdb.Material._3F4,
    datatype=mdb.MeasurementDataType.ComplexPermeability,
    datasource=mdb.MaterialDataSource.ManufacturerDatasheet)

Describe the solution you'd like

  • raise a warning ( https://docs.python.org/3/library/warnings.html ) when temperature or frequency are out of range, e.g. "temperature=-20 is outside of range [25, 100]". Use case: quick visual feedback.
  • return a tuple of (values, info_dict) similar to the info_dict returned by scipy.curve_fit ( https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.curve_fit.html ). where info_dict contains:
    • a boolean value indicating whether or not the values were extrapolated, e.g. {"extrapolated": False}. Use case: annotation in subsequent analyses.
    • (nice to have) the maximum distance to the nearest neighbor along the temperature and frequency axes, e.g.: {"furthest_neighbor": (0, 15000)}, indicating that the furthest point away in the interpolation was 0C and 15000 Hz away from the requested point. Use case: proxy for uncertainty.
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

1 participant