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

auto size single line cablearray to fit sectionarray in Section DataFrame #97

Open
adriengoeller opened this issue Feb 7, 2025 · 0 comments
Labels
enhancement New feature or request ⚔️user api
Milestone

Comments

@adriengoeller
Copy link
Member

Actual behavior: user has to do

cable_data = pd.DataFrame(
		{
			"section": [345.55],
			"diameter": [22.4],
			"linear_weight": [9.55494],
			"young_modulus": [59],
			"dilatation_coefficient": [23],
			"temperature_reference": [0],
		}
	)
cable_array = CableArray(cable_data.loc[cable_data.index.repeat(4)].reset_index(drop=True))
cable_array.data
#------
	section	diameter	linear_weight	young_modulus	dilatation_coefficient	temperature_reference
0	0.000346	0.0224	9.55494	5.900000e+10	0.000023	0.0
1	0.000346	0.0224	9.55494	5.900000e+10	0.000023	0.0
2	0.000346	0.0224	9.55494	5.900000e+10	0.000023	0.0
3	0.000346	0.0224	9.55494	5.900000e+10	0.000023	0.0

in order to have 4 identical cable for a section.

The idea is to add a .repeat method. This method can be used by the user in this way:

cable_array.repeat(n=4)
#------
	section	diameter	linear_weight	young_modulus	dilatation_coefficient	temperature_reference
0	0.000346	0.0224	9.55494	5.900000e+10	0.000023	0.0
1	0.000346	0.0224	9.55494	5.900000e+10	0.000023	0.0
2	0.000346	0.0224	9.55494	5.900000e+10	0.000023	0.0
3	0.000346	0.0224	9.55494	5.900000e+10	0.000023	0.0
@adriengoeller adriengoeller converted this from a draft issue Feb 7, 2025
@adriengoeller adriengoeller added the enhancement New feature or request label Feb 7, 2025
@adriengoeller adriengoeller added this to the v0.3.0 milestone Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request ⚔️user api
Projects
Status: 💻Selected
Development

No branches or pull requests

1 participant