shipshape 0.2.0__tar.gz → 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. shipshape-0.3.0/PKG-INFO +117 -0
  2. shipshape-0.3.0/README.md +94 -0
  3. {shipshape-0.2.0 → shipshape-0.3.0}/pyproject.toml +1 -1
  4. shipshape-0.3.0/src/shipshape/parameter/__init__.py +1 -0
  5. {shipshape-0.2.0 → shipshape-0.3.0}/src/shipshape/parameter/__main__.py +6 -3
  6. shipshape-0.2.0/PKG-INFO +0 -45
  7. shipshape-0.2.0/README.md +0 -22
  8. shipshape-0.2.0/src/shipshape/parameter/__init__.py +0 -5
  9. shipshape-0.2.0/src/shipshape/parameter/compute.py +0 -139
  10. {shipshape-0.2.0 → shipshape-0.3.0}/.github/workflows/publish.yml +0 -0
  11. {shipshape-0.2.0 → shipshape-0.3.0}/.gitignore +0 -0
  12. {shipshape-0.2.0 → shipshape-0.3.0}/LICENSE +0 -0
  13. {shipshape-0.2.0 → shipshape-0.3.0}/src/shipshape/__init__.py +0 -0
  14. {shipshape-0.2.0 → shipshape-0.3.0}/src/shipshape/buoyancy/__init__.py +0 -0
  15. {shipshape-0.2.0 → shipshape-0.3.0}/src/shipshape/buoyancy/__main__.py +0 -0
  16. {shipshape-0.2.0 → shipshape-0.3.0}/src/shipshape/buoyancy/solve.py +0 -0
  17. {shipshape-0.2.0 → shipshape-0.3.0}/src/shipshape/gz/__init__.py +0 -0
  18. {shipshape-0.2.0 → shipshape-0.3.0}/src/shipshape/gz/__main__.py +0 -0
  19. {shipshape-0.2.0 → shipshape-0.3.0}/src/shipshape/gz/compute.py +0 -0
  20. {shipshape-0.2.0 → shipshape-0.3.0}/src/shipshape/mass/__init__.py +0 -0
  21. {shipshape-0.2.0 → shipshape-0.3.0}/src/shipshape/mass/__main__.py +0 -0
  22. {shipshape-0.2.0 → shipshape-0.3.0}/src/shipshape/mass/analyze.py +0 -0
  23. {shipshape-0.2.0 → shipshape-0.3.0}/src/shipshape/physics/__init__.py +0 -0
  24. {shipshape-0.2.0 → shipshape-0.3.0}/src/shipshape/physics/__main__.py +0 -0
  25. {shipshape-0.2.0 → shipshape-0.3.0}/src/shipshape/physics/center_of_buoyancy.py +0 -0
  26. {shipshape-0.2.0 → shipshape-0.3.0}/src/shipshape/physics/center_of_mass.py +0 -0
  27. {shipshape-0.2.0 → shipshape-0.3.0}/src/shipshape/validate_structure/__init__.py +0 -0
  28. {shipshape-0.2.0 → shipshape-0.3.0}/src/shipshape/validate_structure/__main__.py +0 -0
  29. {shipshape-0.2.0 → shipshape-0.3.0}/src/shipshape/validate_structure/aka_analysis.py +0 -0
  30. {shipshape-0.2.0 → shipshape-0.3.0}/src/shipshape/validate_structure/aka_point_load.py +0 -0
  31. {shipshape-0.2.0 → shipshape-0.3.0}/src/shipshape/validate_structure/beam_mechanics.py +0 -0
  32. {shipshape-0.2.0 → shipshape-0.3.0}/src/shipshape/validate_structure/brace_analysis.py +0 -0
  33. {shipshape-0.2.0 → shipshape-0.3.0}/src/shipshape/validate_structure/capsize_analysis.py +0 -0
  34. {shipshape-0.2.0 → shipshape-0.3.0}/src/shipshape/validate_structure/diagrams.py +0 -0
  35. {shipshape-0.2.0 → shipshape-0.3.0}/src/shipshape/validate_structure/gunwale_analysis.py +0 -0
  36. {shipshape-0.2.0 → shipshape-0.3.0}/src/shipshape/validate_structure/lifting_sling.py +0 -0
  37. {shipshape-0.2.0 → shipshape-0.3.0}/src/shipshape/validate_structure/mast_analysis.py +0 -0
  38. {shipshape-0.2.0 → shipshape-0.3.0}/src/shipshape/validate_structure/spine_analysis.py +0 -0
  39. {shipshape-0.2.0 → shipshape-0.3.0}/src/shipshape/validate_structure/validate.py +0 -0
  40. {shipshape-0.2.0 → shipshape-0.3.0}/src/shipshape/validate_structure/wave_slam.py +0 -0
@@ -0,0 +1,117 @@
1
+ Metadata-Version: 2.4
2
+ Name: shipshape
3
+ Version: 0.3.0
4
+ Summary: Open-source parametric vessel design and validation library
5
+ Project-URL: Homepage, https://github.com/solar-proa/shipshape
6
+ Project-URL: Repository, https://github.com/solar-proa/shipshape
7
+ Author-email: Solar Proa <solar.proa@gmail.com>
8
+ License-Expression: MIT
9
+ License-File: LICENSE
10
+ Keywords: hydrostatics,naval-architecture,structural-validation,vessel-design
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: Science/Research
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Topic :: Scientific/Engineering
16
+ Requires-Python: >=3.10
17
+ Requires-Dist: numpy
18
+ Provides-Extra: diagrams
19
+ Requires-Dist: matplotlib; extra == 'diagrams'
20
+ Provides-Extra: geometry
21
+ Requires-Dist: numpy; extra == 'geometry'
22
+ Description-Content-Type: text/markdown
23
+
24
+ # shipshape
25
+
26
+ Open-source parametric vessel design and validation library.
27
+
28
+ Shipshape provides boat-design-independent tools for naval engineering analysis. It is used by [Solar Proa CAD](https://github.com/solar-proa/CAD) but can be applied to any parametric vessel design.
29
+
30
+ ## Modules
31
+
32
+ | Module | Description | Requires FreeCAD |
33
+ |--------|-------------|------------------|
34
+ | `parameter` | Merge base parameters and compute derived values via a project-supplied plugin | No |
35
+ | `mass` | Compute component masses from a FreeCAD design and material properties | Yes |
36
+ | `buoyancy` | Find equilibrium pose (sinkage, pitch, roll) using Newton-Raphson iteration | Yes |
37
+ | `gz` | Compute the GZ righting-arm curve over a range of heel angles | Yes |
38
+ | `physics` | Center-of-gravity and center-of-buoyancy calculations | Yes |
39
+ | `validate_structure` | Structural validation: aka, mast, spine, brace, gunwale, wave slam, capsize analysis | No |
40
+
41
+ ## Installation
42
+
43
+ ```bash
44
+ pip install shipshape
45
+ ```
46
+
47
+ For modules that require FreeCAD geometry (mass, buoyancy, gz, physics), install FreeCAD via conda-forge:
48
+
49
+ ```bash
50
+ conda install -c conda-forge freecad
51
+ ```
52
+
53
+ For diagram generation (validate_structure plots):
54
+
55
+ ```bash
56
+ pip install shipshape[diagrams]
57
+ ```
58
+
59
+ ## CLI Usage
60
+
61
+ Each module can be run as a CLI tool via `python -m shipshape.<module>`.
62
+
63
+ ### parameter
64
+
65
+ Merges boat and configuration JSON files, then calls a project-supplied `compute_derived()` function to calculate derived values.
66
+
67
+ ```bash
68
+ PYTHONPATH=. python -m shipshape.parameter \
69
+ --compute myproject.parameter.compute \
70
+ --boat constants/boats/boat.json \
71
+ --configuration constants/configurations/config.json \
72
+ --output artifact/parameters.json
73
+ ```
74
+
75
+ The `--compute` argument is a dotted module path. The module must export a `compute_derived(data: dict) -> dict` function.
76
+
77
+ ### mass
78
+
79
+ ```bash
80
+ python -m shipshape.mass \
81
+ --design artifact/boat.design.FCStd \
82
+ --materials constants/material/materials.json \
83
+ --output artifact/boat.mass.json
84
+ ```
85
+
86
+ ### buoyancy
87
+
88
+ ```bash
89
+ python -m shipshape.buoyancy \
90
+ --design artifact/boat.design.FCStd \
91
+ --materials constants/material/materials.json \
92
+ --output artifact/boat.buoyancy.json
93
+ ```
94
+
95
+ ### gz
96
+
97
+ ```bash
98
+ python -m shipshape.gz \
99
+ --design artifact/boat.design.FCStd \
100
+ --buoyancy artifact/boat.buoyancy.json \
101
+ --output artifact/boat.gz.json \
102
+ --output-png artifact/boat.gz.png
103
+ ```
104
+
105
+ ### validate_structure
106
+
107
+ ```bash
108
+ python -m shipshape.validate_structure \
109
+ --parameters artifact/parameters.json \
110
+ --mass artifact/boat.mass.json \
111
+ --gz artifact/boat.gz.json \
112
+ --output artifact/boat.validation.json
113
+ ```
114
+
115
+ ## License
116
+
117
+ MIT
@@ -0,0 +1,94 @@
1
+ # shipshape
2
+
3
+ Open-source parametric vessel design and validation library.
4
+
5
+ Shipshape provides boat-design-independent tools for naval engineering analysis. It is used by [Solar Proa CAD](https://github.com/solar-proa/CAD) but can be applied to any parametric vessel design.
6
+
7
+ ## Modules
8
+
9
+ | Module | Description | Requires FreeCAD |
10
+ |--------|-------------|------------------|
11
+ | `parameter` | Merge base parameters and compute derived values via a project-supplied plugin | No |
12
+ | `mass` | Compute component masses from a FreeCAD design and material properties | Yes |
13
+ | `buoyancy` | Find equilibrium pose (sinkage, pitch, roll) using Newton-Raphson iteration | Yes |
14
+ | `gz` | Compute the GZ righting-arm curve over a range of heel angles | Yes |
15
+ | `physics` | Center-of-gravity and center-of-buoyancy calculations | Yes |
16
+ | `validate_structure` | Structural validation: aka, mast, spine, brace, gunwale, wave slam, capsize analysis | No |
17
+
18
+ ## Installation
19
+
20
+ ```bash
21
+ pip install shipshape
22
+ ```
23
+
24
+ For modules that require FreeCAD geometry (mass, buoyancy, gz, physics), install FreeCAD via conda-forge:
25
+
26
+ ```bash
27
+ conda install -c conda-forge freecad
28
+ ```
29
+
30
+ For diagram generation (validate_structure plots):
31
+
32
+ ```bash
33
+ pip install shipshape[diagrams]
34
+ ```
35
+
36
+ ## CLI Usage
37
+
38
+ Each module can be run as a CLI tool via `python -m shipshape.<module>`.
39
+
40
+ ### parameter
41
+
42
+ Merges boat and configuration JSON files, then calls a project-supplied `compute_derived()` function to calculate derived values.
43
+
44
+ ```bash
45
+ PYTHONPATH=. python -m shipshape.parameter \
46
+ --compute myproject.parameter.compute \
47
+ --boat constants/boats/boat.json \
48
+ --configuration constants/configurations/config.json \
49
+ --output artifact/parameters.json
50
+ ```
51
+
52
+ The `--compute` argument is a dotted module path. The module must export a `compute_derived(data: dict) -> dict` function.
53
+
54
+ ### mass
55
+
56
+ ```bash
57
+ python -m shipshape.mass \
58
+ --design artifact/boat.design.FCStd \
59
+ --materials constants/material/materials.json \
60
+ --output artifact/boat.mass.json
61
+ ```
62
+
63
+ ### buoyancy
64
+
65
+ ```bash
66
+ python -m shipshape.buoyancy \
67
+ --design artifact/boat.design.FCStd \
68
+ --materials constants/material/materials.json \
69
+ --output artifact/boat.buoyancy.json
70
+ ```
71
+
72
+ ### gz
73
+
74
+ ```bash
75
+ python -m shipshape.gz \
76
+ --design artifact/boat.design.FCStd \
77
+ --buoyancy artifact/boat.buoyancy.json \
78
+ --output artifact/boat.gz.json \
79
+ --output-png artifact/boat.gz.png
80
+ ```
81
+
82
+ ### validate_structure
83
+
84
+ ```bash
85
+ python -m shipshape.validate_structure \
86
+ --parameters artifact/parameters.json \
87
+ --mass artifact/boat.mass.json \
88
+ --gz artifact/boat.gz.json \
89
+ --output artifact/boat.validation.json
90
+ ```
91
+
92
+ ## License
93
+
94
+ MIT
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "shipshape"
7
- version = "0.2.0"
7
+ version = "0.3.0"
8
8
  description = "Open-source parametric vessel design and validation library"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -0,0 +1 @@
1
+ """Parameter computation for parametric vessel designs."""
@@ -1,21 +1,24 @@
1
1
  #!/usr/bin/env python3
2
2
  """CLI entry point for parameter computation."""
3
3
 
4
+ import importlib
4
5
  import json
5
6
  import os
6
7
  import argparse
7
8
 
8
- from .compute import compute_derived
9
-
10
9
 
11
10
  def main():
12
11
  parser = argparse.ArgumentParser(description='Compute parameters')
12
+ parser.add_argument('--compute', required=True,
13
+ help='Dotted module path providing compute_derived()')
13
14
  parser.add_argument('--boat', required=True, help='Path to boat constants')
14
15
  parser.add_argument('--configuration', required=True, help='Path to configuration constants')
15
16
  parser.add_argument('--output', required=True, help='Path to output JSON artifact')
16
17
 
17
18
  args = parser.parse_args()
18
19
 
20
+ module = importlib.import_module(args.compute)
21
+
19
22
  with open(args.boat, 'r') as b:
20
23
  boat_data = json.load(b)
21
24
 
@@ -23,7 +26,7 @@ def main():
23
26
  configuration_data = json.load(c)
24
27
 
25
28
  data = boat_data | configuration_data
26
- data = compute_derived(data)
29
+ data = module.compute_derived(data)
27
30
 
28
31
  os.makedirs(os.path.dirname(args.output) or '.', exist_ok=True)
29
32
  with open(args.output, 'w') as f:
shipshape-0.2.0/PKG-INFO DELETED
@@ -1,45 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: shipshape
3
- Version: 0.2.0
4
- Summary: Open-source parametric vessel design and validation library
5
- Project-URL: Homepage, https://github.com/solar-proa/shipshape
6
- Project-URL: Repository, https://github.com/solar-proa/shipshape
7
- Author-email: Solar Proa <solar.proa@gmail.com>
8
- License-Expression: MIT
9
- License-File: LICENSE
10
- Keywords: hydrostatics,naval-architecture,structural-validation,vessel-design
11
- Classifier: Development Status :: 3 - Alpha
12
- Classifier: Intended Audience :: Science/Research
13
- Classifier: License :: OSI Approved :: MIT License
14
- Classifier: Programming Language :: Python :: 3
15
- Classifier: Topic :: Scientific/Engineering
16
- Requires-Python: >=3.10
17
- Requires-Dist: numpy
18
- Provides-Extra: diagrams
19
- Requires-Dist: matplotlib; extra == 'diagrams'
20
- Provides-Extra: geometry
21
- Requires-Dist: numpy; extra == 'geometry'
22
- Description-Content-Type: text/markdown
23
-
24
- # shipshape
25
-
26
- Open-source parametric vessel design and validation library.
27
-
28
- ## Installation
29
-
30
- ```
31
- pip install shipshape
32
- ```
33
-
34
- ## Usage
35
-
36
- ```python
37
- from shipshape.parameter import compute_derived
38
- from shipshape.validate_structure import run_validation
39
-
40
- # Compute derived parameters from base parameters
41
- params = compute_derived(base_params)
42
-
43
- # Run structural validation
44
- results = run_validation(params, mass_data)
45
- ```
shipshape-0.2.0/README.md DELETED
@@ -1,22 +0,0 @@
1
- # shipshape
2
-
3
- Open-source parametric vessel design and validation library.
4
-
5
- ## Installation
6
-
7
- ```
8
- pip install shipshape
9
- ```
10
-
11
- ## Usage
12
-
13
- ```python
14
- from shipshape.parameter import compute_derived
15
- from shipshape.validate_structure import run_validation
16
-
17
- # Compute derived parameters from base parameters
18
- params = compute_derived(base_params)
19
-
20
- # Run structural validation
21
- results = run_validation(params, mass_data)
22
- ```
@@ -1,5 +0,0 @@
1
- """Parameter computation for parametric vessel designs."""
2
-
3
- from .compute import compute_derived
4
-
5
- __all__ = ["compute_derived"]
@@ -1,139 +0,0 @@
1
- """Compute derived parameters from base parameters."""
2
-
3
- from typing import Dict, Any
4
-
5
-
6
- def compute_derived(base: Dict[str, Any]) -> Dict[str, Any]:
7
- """
8
- Compute all derived parameters from base parameters.
9
- Returns a complete parameter dictionary with both base and derived values.
10
- """
11
- params = base.copy()
12
-
13
- # Constants
14
- mm_in_one_inch = 25.4
15
-
16
- # Derived dimensions
17
- params['mm_in_one_inch'] = mm_in_one_inch
18
- params['stringer_width'] = base['stringer_width_inches'] * mm_in_one_inch
19
- params['clamp_width'] = base['clamp_width_inches'] * mm_in_one_inch
20
- params['clamp_height'] = base['clamp_height_inches'] * mm_in_one_inch
21
- params['vaka_stringer_width'] = base['vaka_stringer_width_inches'] * mm_in_one_inch
22
- params['vaka_stringer_height'] = base['vaka_stringer_height_inches'] * mm_in_one_inch
23
- params['frame_width'] = base['frame_width_inches'] * mm_in_one_inch
24
- params['frame_depth'] = base['frame_depth_inches'] * mm_in_one_inch
25
- params['bottom_height'] = base['bottom_height_inches'] * mm_in_one_inch
26
-
27
- # Aka length depends on panels and deck
28
- params['aka_length'] = (base['panel_length'] * base['panels_transversal'] +
29
- base['deck_width'])
30
-
31
- # Bottom thickness same as vaka
32
- params['bottom_thickness'] = base['vaka_thickness']
33
-
34
- # Crossdeck dimensions
35
- params['crossdeck_width'] = base['panel_width'] / base['akas_per_panel']
36
- params['crossdeck_thickness'] = base['deck_thickness']
37
- params['crossdeck_length'] = (base['panels_transversal'] * base['panel_length'] +
38
- (base['deck_width'] - base['vaka_width']) / 2 +
39
- params['stringer_width'])
40
-
41
- # Cockpit length: distance from center to first aka's inner edge, doubled
42
- # First aka Y position depends on akas_per_panel:
43
- # - Single aka: centered in panel at crossdeck_width/2 + panel_width/2
44
- # - Multiple akas: at rim distance from panel edge at crossdeck_width/2 + aka_rim
45
- if base.get('akas_per_panel', 1) == 1:
46
- first_aka_y = params['crossdeck_width'] / 2 + base['panel_width'] / 2
47
- else:
48
- first_aka_y = params['crossdeck_width'] / 2 + base['aka_rim']
49
- params['cockpit_length'] = 2 * first_aka_y - base['aka_width']
50
-
51
- # Panel stringer calculations
52
- params['panel_stringer_offset'] = (base['panel_length'] / 4 -
53
- params['stringer_width'] / 2)
54
- params['panel_stringer_length'] = (params['crossdeck_width'] +
55
- base['panels_longitudinal'] * base['panel_width'])
56
-
57
- # Vertical levels (build up from bottom)
58
- params['clamp_base_level'] = (params['bottom_height'] + base['freeboard'] -
59
- params['clamp_height'])
60
- params['vaka_stringer_base_level'] = params['clamp_base_level'] - params['freeboard'] / 2
61
- params['overhead_base_level'] = (params['clamp_base_level'] +
62
- params['clamp_height'])
63
- params['aka_base_level'] = (params['overhead_base_level'] +
64
- base['overhead_thickness'])
65
- params['stringer_base_level'] = params['aka_base_level'] + base['aka_height']
66
- params['panel_base_level'] = params['stringer_base_level'] + params['stringer_width']
67
- params['deck_base_level'] = params['panel_base_level']
68
- params['deck_level'] = params['deck_base_level'] + base['deck_thickness']
69
-
70
- # Spine (uses same sizes as aka)
71
- params['spine_thickness'] = base['aka_thickness']
72
- params['spine_width'] = base['aka_width']
73
- params['spine_base_level'] = params['aka_base_level'] - params['spine_width']
74
- params['spine_length'] = (base['panel_width'] * base['panels_longitudinal'] +
75
- params['crossdeck_width'] + base['spine_length_extension'])
76
-
77
- # Beam calculation
78
- params['beam'] = (params['aka_length'] + base['aka_cap_thickness'] -
79
- params['spine_width'] + base['ama_diameter'] / 2)
80
-
81
- # Pillar (uses same sizes as aka)
82
- params['pillar_thickness'] = base['aka_thickness']
83
- params['pillar_width'] = base['aka_width']
84
- params['pillar_height'] = params['spine_base_level'] - base['ama_thickness']
85
-
86
- # Ama cone length: cone starts at outer edge of outermost pillar
87
- # Calculate Y position of the outermost (last) aka
88
- last_panel_index = base['panels_longitudinal'] // 2 - 1
89
- last_aka_index = base.get('akas_per_panel', 1) - 1
90
- if base.get('akas_per_panel', 1) == 1:
91
- last_aka_y = (params['crossdeck_width'] / 2
92
- + last_panel_index * base['panel_width']
93
- + base['panel_width'] / 2)
94
- else:
95
- aka_spacing = ((base['panel_width'] - 2 * base['aka_rim'])
96
- / (base['akas_per_panel'] - 1))
97
- last_aka_y = (params['crossdeck_width'] / 2
98
- + last_panel_index * base['panel_width']
99
- + base['aka_rim'] + last_aka_index * aka_spacing)
100
-
101
- # Vaka x offset (distance from ama centerline to vaka centerline)
102
- params['vaka_x_offset'] = (- params['pillar_width'] / 2
103
- + base['panel_length'] * base['panels_transversal']
104
- + base['deck_width'] / 2)
105
-
106
- # Mast calculations
107
- params['mast_distance_from_center'] = (base['vaka_length'] / 4 +
108
- base['mast_distance_from_center_offset'])
109
- params['mast_base_level'] = params['bottom_height'] + base['sole_thickness']
110
- params['mast_partner_length'] = (base['vaka_width'] -
111
- base['mast_partner_vaka_clearance'])
112
- params['mast_partner_width'] = (base['mast_diameter'] +
113
- base['mast_partner_width_offset'])
114
- params['mast_step_outer_diameter'] = (base['mast_diameter'] +
115
- base['mast_step_diameter_offset'])
116
- params['mast_step_inner_diameter'] = base['mast_diameter']
117
-
118
- # Yard spar height
119
- params['yard_spar_height'] = (base['mast_height'] -
120
- base['yard_spar_distance_from_top'])
121
-
122
- # Boom length matches yard length (rectangular sails)
123
- params['boom_length'] = base['yard_length']
124
- params['sail_area_m2'] = (2 * base['sail_height'] / 1000
125
- * base['sail_width'] / 1000)
126
-
127
- # Rudder calculations
128
- params['rudder_bearing_block_height'] = params['stringer_width']
129
- params['rudder_vaka_mount_base_level'] = ((params['bottom_height'] +
130
- base['freeboard']) / 2)
131
- params['rudder_rib_length'] = (base['rudder_blade_length'] -
132
- base['rudder_rib_clearance'])
133
-
134
- # Tiller dimensions (uses stringer sizes)
135
- params['tiller_width'] = params['stringer_width']
136
- params['tiller_thickness'] = base['stringer_thickness']
137
- params['tiller_length'] = 490 # This was hardcoded in original
138
-
139
- return params
File without changes
File without changes