Skip to content

implement new features, fix small bugs#3

Merged
gituser789 merged 24 commits into
mainfrom
develop
Nov 4, 2025
Merged

implement new features, fix small bugs#3
gituser789 merged 24 commits into
mainfrom
develop

Conversation

@gituser789
Copy link
Copy Markdown
Contributor

Implemented new features:

  • add new foil capacitor series for comparison
  • add component cost models to estimate price in €
  • Improve required minimum capacitance calculation
  • use series-dependent max delta_t_jc value

fix bugs:

  • fix calculation factor from m³ to dm³

@gituser789 gituser789 self-assigned this Oct 31, 2025
Copy link
Copy Markdown

@SevenOfNinePE SevenOfNinePE left a comment

Choose a reason for hiding this comment

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

You add files dvdt.py and current_capability.py. In my opinion a class could structure it in a better way. On the other hand you introduce the class 'FatigueCurve' and 'SemiLogCurve', but implement the main algorithm part within the function 'voltage_rating_due_to_lifetime'. This is confusing.
However I do not find a point, to request changes.

Comment thread cst/esr_downloads.py Outdated
:type capacitor_type_list: CapacitorType
"""
c_db, c_thermal, c_derating = load_capacitors(capacitor_type_list)
def download_esr_csv_files() -> None:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No input parameter is provided anymore. Which type will be downloaded now?
I guess these in the 'FOIL_CAPACITOR_SERIES_NAME_LIST'. But this approach establish a dependency to this list, which makes this function less universal.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed by adding a list of capacitor series names to download.
If no list is provided, the default list is used

Comment thread cst/lifetime.py
from cst.cst_dataclasses import LifetimeDerating

class FatigueCurve:
"""
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Class consists only of members, but no methods. Why not dataclass?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

has been fixed and is a function from now on

Comment thread cst/lifetime.py Outdated
__call__ = get_voltage

def voltage_rating_due_to_lifetime(target_lifetime: float, operating_temperature: float, voltage_rating: float,
lt_dto_list: list[LifetimeDerating], is_plot: bool = False) -> float:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This function uses the class 'SemiLogCurve' to get information. The used class is very simple, so that it can also be substitute by a function. What is the reason for using a class? The main function 'voltage_rating_due_to_lifetime' could be also a method of the class. In this case a class makes more sense.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

changed to a function

Comment thread cst/lifetime.py
voltage = curve.get_voltage(target_lifetime)

if is_plot:
plt.semilogx(df_lower["lifetime"], df_lower["voltage"], label=f"{temperature_lower} °C")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I would separate the plot from the function.
Background: The display of the calculations can be implemented by the user on his need. Here in case of 'is_plot' the calculation will be interrupted by the plot. But is_plot are used also at other locations, so that also there a plot is visible. Plotting is not bad, but I like separation of calculation and display results.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

it is more for debugging

@gituser789 gituser789 merged commit 698aa62 into main Nov 4, 2025
1 check passed
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

Successfully merging this pull request may close these issues.

2 participants