Skip to content

Commit 7d0f337

Browse files
Merge pull request #23 from TristanHehnen/main
Changed license to MPL 2.0
2 parents 30a1632 + e5d4874 commit 7d0f337

16 files changed

Lines changed: 304 additions & 451 deletions

File tree

CONTRIBUTING.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Contributing to FireSciPy
2+
3+
Thank you for your interest in contributing! FireSciPy is a community-driven project,
4+
and contributions of all kinds are welcome — including code, documentation, examples,
5+
bug reports, feature requests, and discussion.
6+
7+
---
8+
9+
## How to Contribute
10+
11+
### 1. Reporting Issues
12+
If you find a bug, have a question, or want to request a new feature, please open an
13+
issue on GitHub. When reporting a bug, try to include:
14+
- A clear description of the problem
15+
- Steps to reproduce
16+
- Expected behavior
17+
- Your Python version and platform
18+
19+
### 2. Making Code Contributions
20+
1. Fork the repository
21+
2. Create a **new branch** for your work:
22+
`git checkout -b feature/my-improvement`
23+
3. Make your changes
24+
4. Add tests if applicable
25+
5. Submit a pull request with a clear explanation of what the change does and why
26+
27+
We try to keep the code readable and maintainable. If you're unsure about design
28+
choices, open an issue or draft PR first and we can discuss.
29+
30+
---
31+
32+
## Licensing (Important)
33+
34+
FireSciPy is licensed under the **Mozilla Public License Version 2.0 (MPL-2.0)**.
35+
36+
By submitting a pull request, **you agree that your contributions will be licensed under
37+
the MPL-2.0**, which ensures:
38+
- Your improvements to FireSciPy remain open and available to the community
39+
- You retain your own copyright to your contributions
40+
41+
No Contributor License Agreement (CLA) is required.
42+
43+
For more information on MPL-2.0:
44+
https://www.mozilla.org/en-US/MPL/2.0/
45+
46+
---
47+
48+
## Code Style
49+
50+
- Follow general [PEP 8](https://peps.python.org/pep-0008/) guidelines
51+
- Write clear variable names, meaningful docstrings, and comments where helpful
52+
- Keep functions small and focused where possible
53+
54+
---
55+
56+
## Thank You
57+
58+
Your contribution helps move the field of fire science forward.
59+
We’re glad to have you here!

LICENSE

Lines changed: 104 additions & 341 deletions
Large diffs are not rendered by default.

NOTICE

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FireSciPy
2+
Copyright (c) 2025 FireSciPy contributors
3+
4+
This project is licensed under the Mozilla Public License Version 2.0.
5+
https://www.mozilla.org/en-US/MPL/2.0/
6+
7+
Some portions of this project may incorporate or adapt work from other open-source
8+
projects. Attributions for such components are included in the relevant source files
9+
and documentation where required.

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ Examples are available in Jupyter notebooks in the [FireSciPy repo on GitHub](ht
1010

1111
## Meta Information
1212

13-
Distributed under the CC-BY-4.0 license (Creative Commons Attribution 4.0 International Public License, https://creativecommons.org/licenses/by/4.0/). See ``LICENSE`` for more information.
13+
This project is licensed under the Mozilla Public License Version 2.0.
14+
https://www.mozilla.org/en-US/MPL/2.0/
15+
16+
See ``LICENSE`` for more information.
1417

1518
[https://github.com/FireDynamics/FireSciPy](https://github.com/FireDynamics/FireSciPy)
1619

@@ -21,6 +24,8 @@ Contributions to this package are welcome!
2124

2225
Please feel free to use the [discussions forum](https://github.com/FireDynamics/FireSciPy/discussions) or the [issue tracker](https://github.com/FireDynamics/FireSciPy/issues) to get in contact with us. From there, we can talk about your ideas and see how to implement them.
2326

27+
Note: From version 0.1.0 onward, the main branch should contain only stable versions and no development on the main branch is permitted. Create new branches for development work, regardless if it is for fixing bugs or adding new features.
28+
2429
Practical summary for contributions directly to the repo:
2530

2631
1. Fork it (<https://github.com/FireDynamics/FireSciPy/fork>)

docs/tutorials/pyrolysis/notebooks/FireSciPy_KAS_Demo.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
"# SciPy version: 1.16.1\n",
7777
"# Pandas version: 2.3.1\n",
7878
"# Matplotlib version: 3.10.5\n",
79-
"# FireSciPy version: 0.0.3\n",
79+
"# FireSciPy version: 0.0.5\n",
8080
"\n",
8181
"\n",
8282
"print('Package Versions')\n",

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "firescipy"
7-
version = "0.0.5"
7+
version = "0.0.6"
88
description = "FireSciPy: Fundamental algorithms from the field of fire science, for computations with Python."
99
readme = "README.md"
1010
keywords = ["Fire Safety Engineering", "fire", "pyrolysis", "kinetics", "FDS"]
1111
requires-python = ">=3.9"
12-
license = { text = "CC-BY-4.0" } # adjust if you use another license
13-
license-files = ["LICEN[CS]E*"]
12+
license = { file = "LICENSE" }
1413
authors = [
1514
{ name = "Tristan Hehnen", email = "you@example.com" },
1615
{ name = "Lukas Arnold", email = "you@example.com" }
1716
]
1817
classifiers = [
1918
"Programming Language :: Python :: 3",
2019
"Operating System :: OS Independent",
20+
"License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)",
2121
"Intended Audience :: Science/Research",
2222
"Topic :: Scientific/Engineering"
2323
]

src/firescipy/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# This Source Code Form is subject to the terms of the Mozilla Public
2+
# License, v. 2.0. If a copy of the MPL was not distributed with this
3+
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
5+
16
from . import utils
27
from . import pyrolysis
38
from . import constants

src/firescipy/constants.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# This Source Code Form is subject to the terms of the Mozilla Public
2+
# License, v. 2.0. If a copy of the MPL was not distributed with this
3+
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
5+
16
"""
27
Physical and chemical constants used throughout FireSciPy.
38
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
1+
# This Source Code Form is subject to the terms of the Mozilla Public
2+
# License, v. 2.0. If a copy of the MPL was not distributed with this
3+
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
5+
16
from .design_fires import alpha_t_squared, simple_design_fire

src/firescipy/handcalculation/design_fires.py

Lines changed: 11 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# This Source Code Form is subject to the terms of the Mozilla Public
2+
# License, v. 2.0. If a copy of the MPL was not distributed with this
3+
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
5+
16
import numpy as np
27

38

@@ -214,106 +219,7 @@ def simple_design_fire(Q_max, Q_total, decay_model="t_squared", **kwargs):
214219
Q_combined = np.concatenate((Q_growth, np.full(2, Q_max), Q_decay))
215220

216221
return t_combined, Q_combined
217-
def ignition(model,**kwargs):
218-
"""
219-
Returnes pre defined fire curves that are usually used as ignition sources.
220-
221-
Parameters
222-
----------
223-
model : str
224-
Name of the ignition source model.
225-
- EN45545-1: Ignition model 5 from EN 45545-1
226-
- TRStrab: Ignition model from TRStrab BS
227-
- E-Bike: Values from https://www.youtube.com/watch?v=2vir4_1qSSc
228-
229-
Optional keyword arguments (`**kwargs`) depending on the selected model:
230-
sampling_rate : float
231-
Sampling rate in Hz. Default is 1 Hz.
232-
233-
Returns
234-
-------
235-
time : np.ndarray
236-
time array in seconds
237-
hrr : np.ndarray
238-
corresponding heat release rate array in kW.
239-
"""
240-
sampling_rate=kwargs.get("sampling_rate", 1)
241-
ignitioncurves={'EN45545-1': np.array((np.array((0,2,2,10,10))*60,np.array((75,75,150,150,0)))),
242-
'TRStrab BS': np.array(([0,300,480,1800],[0,120,150,0])),
243-
'E-Bike': np.array(([0,12,45,84,900],[0,55,900,80,0]))}
244-
values=ignitioncurves[model]
245-
time=np.linspace(0,values[0].max(),values[0].max()*sampling_rate+1)
246-
hrr=np.interp(time,values[0],values[1])
247-
return time,hrr
248222

249-
def din5647(length=20,**kwargs):
250-
"""
251-
Returnes parametrized version of the design fire for trams from DIN 5647/TRStrab BS with six different
252-
design fire phases.
253-
254-
Parameters
255-
----------
256-
length : int
257-
Length of tram in meter. Original model designed for lengths of
258-
- EN45545-1: Ignition model 5 from EN 45545-1
259-
- TRStrab: Ignition model from TRStrab BS
260-
- E-Bike: Values from https://www.youtube.com/watch?v=2vir4_1qSSc
261-
262-
Optional keyword arguments (`**kwargs`) depending on the selected model:
263-
alpha: [float,float]
264-
alpha1 for design fire phase (alpha³ model) in kW/s^3 and alpha2 for design fire phase 2 (alpha² model) in kW/s^2
265-
sampling_rate : float
266-
Sampling rate in Hz. Default is 1 Hz.
267-
268-
Returns
269-
-------
270-
time : np.ndarray
271-
time array in seconds
272-
hrr : np.ndarray
273-
corresponding heat release rate array in kW.
274-
"""
275-
sampling_rate=kwargs.get("sampling_rate", 1)
276-
alpha1,alpha2=kwargs.get("alpha", [5.2E-5,0.025])
277-
x=np.arange(0,4200)
278-
q=np.full(4200,np.nan)
279-
q1=x[0:421]**3*alpha1
280-
q[0:421]=q1
281-
q2=(x[421:901]-360)**2*alpha2+q1[-1]
282-
q[421:901]=q2
283-
qap=q2[-1]
284-
i=900
285-
q3=np.array(((q2[-1]),))
286-
q3max=q3[(i-901)]
287-
while round(q3max)<1387*length:
288-
i+=60
289-
q3=np.append(q3,np.array(((q3[-1]+252*np.exp(0.004*i-1.68)),)),axis=0)
290-
q3max=q3[-1]
291-
i+=61
292-
q[901:i]=np.interp(x[901:i],x[901:i:60],q3)
293-
i=np.where(q>1387*length)[0][0]+300
294-
q4=np.full(300,1387*length)
295-
q[i-300:i]=q4
296-
j=i
297-
q5=np.array(((q4[-1]),))
298-
q5min=q5[-1]
299-
while round(q5min)>0.78*length*1387:
300-
i+=60
301-
q5=np.append(q5,np.array(((0.94*q5[-1]),)),axis=0)
302-
q5min=q5[-1]
303-
#i=i-60
304-
q[j:i]=np.interp(x[j:i],x[j:i+1:60],q5)
305-
i=np.where(q[j:]<0.78*length*1387)[0][0]+j
306-
j=i
307-
q6=np.array((q[i],))
308-
i+=60
309-
while i<=4200:
310-
q6=np.append(q6,np.array(((0.9*q6[-1]),)),axis=0)
311-
i+=60
312-
q[j:i]=np.interp(x[j:i],x[j:i+1:60],q6)
313-
values=np.array((x,q))
314-
time=np.linspace(0,values[0].max(),values[0].max()*sampling_rate+1)
315-
hrr=np.interp(time,values[0],values[1])
316-
return time,hrr
317223

318224
def ignition(model,**kwargs):
319225
"""
@@ -326,7 +232,7 @@ def ignition(model,**kwargs):
326232
- EN45545-1: Ignition model 5 from EN 45545-1
327233
- TRStrab: Ignition model from TRStrab BS
328234
- E-Bike: Values from https://www.youtube.com/watch?v=2vir4_1qSSc
329-
235+
330236
Optional keyword arguments (`**kwargs`) depending on the selected model:
331237
sampling_rate : float
332238
Sampling rate in Hz. Default is 1 Hz.
@@ -347,6 +253,7 @@ def ignition(model,**kwargs):
347253
hrr=np.interp(time,values[0],values[1])
348254
return time,hrr
349255

256+
350257
def din5647(length=20,**kwargs):
351258
"""
352259
Returnes parametrized version of the design fire for trams from DIN 5647/TRStrab BS with six different
@@ -355,11 +262,11 @@ def din5647(length=20,**kwargs):
355262
Parameters
356263
----------
357264
length : int
358-
Length of tram in meter. Original model designed for lengths of
265+
Length of tram in meter. Original model designed for lengths of
359266
- EN45545-1: Ignition model 5 from EN 45545-1
360267
- TRStrab: Ignition model from TRStrab BS
361268
- E-Bike: Values from https://www.youtube.com/watch?v=2vir4_1qSSc
362-
269+
363270
Optional keyword arguments (`**kwargs`) depending on the selected model:
364271
alpha: [float,float]
365272
alpha1 for design fire phase (alpha³ model) in kW/s^3 and alpha2 for design fire phase 2 (alpha² model) in kW/s^2
@@ -412,7 +319,6 @@ def din5647(length=20,**kwargs):
412319
i+=60
413320
q[j:i]=np.interp(x[j:i],x[j:i+1:60],q6)
414321
values=np.array((x,q))
415-
time=np.linspace(0,int(values[0].max()),int(values[0].max())*sampling_rate+1)
322+
time=np.linspace(0,values[0].max(),values[0].max()*sampling_rate+1)
416323
hrr=np.interp(time,values[0],values[1])
417-
return time,hrr
418-
324+
return time,hrr

0 commit comments

Comments
 (0)