Skip to content

Commit

Permalink
Use src directory structure. (#8)
Browse files Browse the repository at this point in the history
* Use src directory structure.

Also remove MANIFEST.in, since all the data files seems to be picked up
by setuptools by default.

* Add test.

* Fix inclusion of data files.
  • Loading branch information
mancellin authored Apr 12, 2024
1 parent 0614b2c commit 306e363
Show file tree
Hide file tree
Showing 14 changed files with 21 additions and 6 deletions.
4 changes: 0 additions & 4 deletions MANIFEST.in

This file was deleted.

7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
name = "stranded-cable"
version = "2024.1.0"
authors = [
{name = "Eurobios", email = "mgueguin@eurobios.com"},
{name = "Eurobios Mews Labs", email = "opentools@mews-labs.com"},
]
description = "stranded-cable is a python package proposed to evaluate stranded cables' physical characteristics."
readme = "README.md"
Expand All @@ -22,5 +22,8 @@ dependencies = [
"matplotlib >= 3.7.1",
]

[tool.setuptools.package-data]
strdcable = ["data/*.csv", "*.ini"]

[project.urls]
"Homepage" = "https://gitlab.eurobios.com/rte/stranded-cable"
"Repository" = "https://github.com/rte-france/pallas-standed-cable"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
16 changes: 16 additions & 0 deletions tests/test_conductor.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import pytest
import numpy as np

def test_conductor():
from strdcable.cable import Conductor
cable = Conductor(
dwires=np.array([3e-3, 2e-3]),
nbwires=np.array([1, 6]),
material=np.array(['ST6C', 'AL1']), # 'ST6C' is a grade of steel, 'AL1' is a grade of aluminium
laylengths=np.array([np.nan, 0.2])
)

assert cable.A == pytest.approx(2.5918139392115792e-05)
assert cable.m == pytest.approx(0.10604410834231327)
assert cable.EA == pytest.approx(2733197.4739603605)

0 comments on commit 306e363

Please sign in to comment.