fconcrete.helpers module

fconcrete.helpers.cond(x, singular=False, order=0)[source]

If It is singular, return 1 if x>0 else 0. If It is not singular, return x**order if x>0 else 0

fconcrete.helpers.duplicated(array)[source]

Check if it is duplicated.

fconcrete.helpers.getAxis(xy0=(0, 0), xy1=(0, 0))[source]

Create axis with equal aspect. xy0 and xy1 represent the visible area.

fconcrete.helpers.integrate(f, a, b, N=100)[source]

Integrate f from a to b in N steps

fconcrete.helpers.make_dxf(ax, **options)[source]

Matplotlib graph to modelspace (preparation to dxf). Returns ax and msp.

fconcrete.helpers.printProgressBar(iteration, total, prefix='', suffix='', decimals=1, length=100, fill='█', printEnd='r')[source]

Call in a loop to create terminal progress bar

fconcrete.helpers.timeit(do=True, name='')[source]

Decorator to print the time that the function has taken to execute.

fconcrete.helpers.to_pandas(array_table)[source]
fconcrete.helpers.to_unit(input, expected_unit, return_unit=False)[source]

Convert between unities according to expected_unit and return_unit.

Call signatures:

fc.helpers.to_unit(input, expected_unit, return_unit=False)
>>> unit1 = fc.helpers.to_unit("10cm", "m")
>>> unit1
0.1
>>> unit2 = fc.helpers.to_unit(20, "m", return_unit="cm")
>>> unit2
2000.0
Parameters:
input : number or python:str

Represents the input unit of the user.

expected_unit : python:str

The expected unit to be given. Useful when input is a number.

return_unit : bool, optional

The desired unit to return