Ohmslaw

Latest version: v2.1.2

Safety actively analyzes 682229 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 2

63.31658291457286

>>>


you can calculate the resistors in series, passing the values ​​in the series() method:

python
>>>from ohmslaw import Ohms
>>>
>>>R1, R2, R3 = 280, 450, 100
>>>
>>>o = Ohms()
>>>
>>>series = o.series(R1, R2, R3)
>>>
>>>print("Resistors in series = ", series)
Resistors in series = 830
>>>



**Full Changelog**: https://github.com/JuanBindez/ohmslaw/compare/v1.0.0...v1.1.0

2.1.2

Release Notes

* updated docs
* updated cli.py which still had the old methods

**Full Changelog**: https://github.com/JuanBindez/ohmslaw/compare/v2.1.1...v2.1.2

2.0.0

Release Notes

* removed the "find_resistor" and "best_combinations" methods
* now ohmslaw only has the `volts`, `current`, `resistance`, `watts`, `series`, and `parallel` methods.

**Full Changelog**: https://github.com/JuanBindez/ohmslaw/compare/v1.3.1...v2.0.0

1.3.1

Release Notes:

- Fixed the current calculation to properly account for the total resistance.
- Adjusted the voltage drop calculation to correctly determine the voltage across the component.
- Ensured the resulting voltage matches the desired component voltage.
- Verified functionality with example values, producing the correct resistor combination and voltage output.

**Full Changelog**: https://github.com/JuanBindez/ohmslaw/compare/v1.2.0...v1.3.1

1.2.0

Release Notes


With this new method you find the appropriate combination for your component

python
>>> from ohmslaw import Ohms
>>>
>>> o = Ohms()
>>>
>>> SOURCE_VOLTAGE = 48
>>> COMPONENT_VOLTAGE = 3
>>> COMPONENT_CURRENT = 0.02 Desired current for the component (e.g., LED)
>>>
>>> resistors = [200, 44, 350, 3, 1200, 500]
>>>
>>> best_combination, resulting_voltage = o.best_combination(SOURCE_VOLTAGE, COMPONENT_VOLTAGE, COMPONENT_CURRENT, resistors)
>>>
>>> print(f"Best combination of resistors: {best_combination}")
Best combination of resistors: (3,)
>>> print(f"Resulting voltage on the component: {resulting_voltage:.2f}V")
Resulting voltage on the component: 0.94V
>>>



**Full Changelog**: https://github.com/JuanBindez/ohmslaw/compare/v1.1.0...v1.2.0

1.1.0

Release Notes

In this version, methods have been added, now you can calculate resistors in series and in parallel

To return resistor value in parallel, simply pass the resistors as an argument in the parallel method

python
>>>from ohmslaw import Ohms
>>>
>>>R1, R2, R3 = 280, 450, 100
>>>
>>>o = Ohms()
>>>
>>>parallel = o.parallel(R1, R2, R3)
>>>
>>>print("Resistor in parallel = ", parallel)

Page 1 of 2

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.