Skip to content

Commit

Permalink
Unpin pandas
Browse files Browse the repository at this point in the history
  • Loading branch information
jschueller committed Sep 20, 2024
1 parent 8da05ef commit a17f754
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 86 deletions.
30 changes: 5 additions & 25 deletions examples/scripts/approximation_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,31 +88,11 @@ def run_FORM_simple(
iter_number = optimResult.getIterationNumber()

dfResult = pd.DataFrame()
dfResult = dfResult.append(
pd.DataFrame([result.getEventProbability()], index=["Probability of failure"])
)
dfResult = dfResult.append(
pd.DataFrame(
[result.getGeneralisedReliabilityIndex()],
index=["Generalised reliability index"],
)
)
dfResult = dfResult.append(
pd.DataFrame([iter_number], index=["Number of iterations"])
)
dfResult = dfResult.append(
pd.DataFrame(
[result.getStandardSpaceDesignPoint()],
index=["Standard space design point"],
)
)
dfResult = dfResult.append(
pd.DataFrame(
[result.getPhysicalSpaceDesignPoint()],
index=["Physical space design point"],
)
)

dfResult = pd.DataFrame([result.getEventProbability()], index=["Probability of failure"])
dfResult = pd.concat([dfResult, pd.DataFrame([result.getGeneralisedReliabilityIndex()], index=["Generalised reliability index"])])
dfResult = pd.concat([dfResult, pd.DataFrame([iter_number()], index=["Number of iterations"])])
dfResult = pd.concat([dfResult, pd.DataFrame([result.getStandardSpaceDesignPoint()], index=["Standard space design point"])])
dfResult = pd.concat([dfResult, pd.DataFrame([result.getPhysicalSpaceDesignPoint()], index=["Physical space design point"])])
dfResult = dfResult.reset_index()
dfResult.columns = ["", "Results - FORM (" + nearestPointAlgo + ")"]
pd.options.display.float_format = "{:,.2E}".format
Expand Down
48 changes: 8 additions & 40 deletions examples/scripts/simulation_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,26 +139,10 @@ def function_intersection(X):

result = simulation.getResult()

dfResult = pd.DataFrame()
dfResult = dfResult.append(
pd.DataFrame(
[result.getProbabilityEstimate()], index=["Probability of failure"]
)
)
dfResult = dfResult.append(
pd.DataFrame(
[result.getCoefficientOfVariation()], index=["Coefficient of varation"],
)
)
dfResult = dfResult.append(
pd.DataFrame([result.getConfidenceLength()], index=["95 % Confidence length"])
)
dfResult = dfResult.append(
pd.DataFrame(
[result.getOuterSampling() * result.getBlockSize()],
index=["Number of calls"],
)
)
dfResult = pd.DataFrame([result.getProbabilityEstimate()], index=["Probability of failure"])
dfResult = pd.concat([dfResult, pd.DataFrame([result.getCoefficientOfVariation()], index=["Coefficient of varation"])])
dfResult = pd.concat([dfResult, pd.DataFrame([result.getConfidenceLength()], index=["95 % Confidence length"])])
dfResult = pd.concat([dfResult, pd.DataFrame([result.getOuterSampling() * result.getBlockSize()], index=["Number of calls"])])
dfResult = dfResult.reset_index()
dfResult.columns = ["", "Results - Monte Carlo"]

Expand Down Expand Up @@ -322,26 +306,10 @@ def function_intersection(X):

result = simulation.getResult()

dfResult = pd.DataFrame()
dfResult = dfResult.append(
pd.DataFrame(
[result.getProbabilityEstimate()], index=["Probability of failure"]
)
)
dfResult = dfResult.append(
pd.DataFrame(
[result.getCoefficientOfVariation()], index=["Coefficient of varation"],
)
)
dfResult = dfResult.append(
pd.DataFrame([result.getConfidenceLength()], index=["95 % Confidence length"])
)
dfResult = dfResult.append(
pd.DataFrame(
[result.getOuterSampling() * result.getBlockSize()],
index=["Number of calls"],
)
)
dfResult = pd.DataFrame([result.getProbabilityEstimate()], index=["Probability of failure"])
dfResult = pd.concat([dfResult, pd.DataFrame([result.getCoefficientOfVariation()], index=["Coefficient of variation"])])
dfResult = pd.concat([dfResult, pd.DataFrame([result.getConfidenceLength()], index=["95 % Confidence length"])])
dfResult = pd.concat([dfResult, pd.DataFrame([result.getOuterSampling() * result.getBlockSize()], index=["Number of calls"])])
dfResult = dfResult.reset_index()
dfResult.columns = ["", "Results - Importance Sampling"]

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pre-commit
flake8
sphinx-gallery
numpydoc
pandas<2.0
pandas
tqdm
shapely
lxml-html-clean
Expand Down
20 changes: 0 additions & 20 deletions requirements.yml

This file was deleted.

0 comments on commit a17f754

Please sign in to comment.