Repository: uncscode/particula

Issue:
allow multi mode dists
allow for kwargs like the following

multi_mode = {
    "mode": [5000e-9, 50e-9, 300e-9], # coarse, nano, fine mode
    "nbins": 1000, # 1000 bins
    "nparticles": [1e6,1e9,1e7], # 1e4 #
    "volume": 1e-6, # per 1e-6 m^3 (or 1 cc)
    "gsigma": [1.5,1.2,1.5], # 
    "spacing": "logspace", # bin spacing, 
}

Discussion:
sourcery-ai[bot]: # Sourcery Code Quality Report

❌ &nbsp;Merging this PR will **decrease** code quality in the affected files by **8.19%**.

| Quality metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| [Complexity](https://docs.sourcery.ai/GitHub/Quality-Report/#complexity) | 1.38 ⭐ | 3.02 ⭐ | 1.64 👎 |
| [Method Length](https://docs.sourcery.ai/GitHub/Quality-Report/#method-length) | 43.12 ⭐ | 72.20 🙂 | 29.08 👎 |
| [Working memory](https://docs.sourcery.ai/GitHub/Quality-Report/#working-memory) | 9.03 🙂 | 10.47 😞 | 1.44 👎 |
| **[Quality](https://docs.sourcery.ai/GitHub/Quality-Report/#quality-score)** | **72.86%** 🙂| **64.67%** 🙂| **-8.19%** 👎 |

| Other metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| Lines | 140 | 230 | 90 |

| Changed files | Quality Before | Quality After | Quality Change |
| --- | :---: | :---: | :---: |
| particula/util/distribution_discretization.py | 64.84% 🙂 | 45.76% 😞 | -19.08% 👎|
| particula/util/radius_cutoff.py | 79.03% ⭐ | 62.95% 🙂 | -16.08% 👎|
| particula/util/tests/distribution_discretization_test.py | 77.32% ⭐ | 77.17% ⭐ | -0.15% 👎|
| particula/util/tests/radius_cutoff_test.py | 75.72% ⭐ | 70.76% 🙂 | -4.96% 👎|

Here are some functions in these files that still need a tune-up:

| File | Function | Complexity | Length | Working Memory | Quality | Recommendation |
| --- | --- | :---: | :---: | :---: | :---: | --- |
| particula/util/distribution_discretization.py | discretize | 10 🙂 | 136 😞 | 16 ⛔ | 45.76% 😞 | Try splitting into smaller methods. Extract out complex expressions |
| particula/util/radius_cutoff.py | cut\_rad | 2 ⭐ | 82 🙂 | 14 😞 | 62.95% 🙂 | Extract out complex expressions |
| particula/util/tests/radius_cutoff_test.py | test\_multi\_cuts | 0 ⭐ | 208 ⛔ | 6 ⭐ | 66.90% 🙂 | Try splitting into smaller methods |

## Legend and Explanation

The emojis denote the absolute quality of the code:

 - ⭐ excellent
 - 🙂 good
 - 😞 poor
 - ⛔ very poor


The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.

***

Please see our documentation [here](https://docs.sourcery.ai/GitHub/Quality-Report/) for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Help us [improve](https://research.typeform.com/to/j06Spdfr?type=quality_report&github_login=ngam&base_repo=https%3A%2F%2Fgithub.com%2Funcscode%2Fparticula.git&base_remote_ref=refs%2Fpull%2F208%2Fhead&base_ref=main&base_sha=2b8103bf81a0e66aeff9d7e76b19dd2309b4d9a6&head_repo=https%3A%2F%2Fgithub.com%2Funcscode%2Fparticula.git&head_ref=sourcery%2Fpull-208&base_pr_number=208&base_pr_state=open) this quality report!
sourcery-ai[bot]: # Sourcery Code Quality Report

❌ &nbsp;Merging this PR will **decrease** code quality in the affected files by **3.73%**.

| Quality metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| [Complexity](https://docs.sourcery.ai/GitHub/Quality-Report/#complexity) | 0.92 ⭐ | 0.94 ⭐ | 0.02 👎 |
| [Method Length](https://docs.sourcery.ai/GitHub/Quality-Report/#method-length) | 33.09 ⭐ | 41.38 ⭐ | 8.29 👎 |
| [Working memory](https://docs.sourcery.ai/GitHub/Quality-Report/#working-memory) | 6.92 🙂 | 7.57 🙂 | 0.65 👎 |
| **[Quality](https://docs.sourcery.ai/GitHub/Quality-Report/#quality-score)** | **82.12%** ⭐| **78.39%** ⭐| **-3.73%** 👎 |

| Other metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| Lines | 422 | 513 | 91 |

| Changed files | Quality Before | Quality After | Quality Change |
| --- | :---: | :---: | :---: |
| particula/particle.py | 85.60% ⭐ | 85.52% ⭐ | -0.08% 👎|
| particula/util/distribution_discretization.py | 64.84% 🙂 | 54.69% 🙂 | -10.15% 👎|
| particula/util/radius_cutoff.py | 79.03% ⭐ | 62.95% 🙂 | -16.08% 👎|
| particula/util/tests/distribution_discretization_test.py | 77.32% ⭐ | 77.17% ⭐ | -0.15% 👎|
| particula/util/tests/radius_cutoff_test.py | 75.72% ⭐ | 70.76% 🙂 | -4.96% 👎|

Here are some functions in these files that still need a tune-up:

| File | Function | Complexity | Length | Working Memory | Quality | Recommendation |
| --- | --- | :---: | :---: | :---: | :---: | --- |
| particula/util/distribution_discretization.py | discretize | 4 ⭐ | 129 😞 | 14 😞 | 54.69% 🙂 | Try splitting into smaller methods. Extract out complex expressions |
| particula/util/radius_cutoff.py | cut\_rad | 2 ⭐ | 82 🙂 | 14 😞 | 62.95% 🙂 | Extract out complex expressions |
| particula/util/tests/radius_cutoff_test.py | test\_multi\_cuts | 0 ⭐ | 208 ⛔ | 6 ⭐ | 66.90% 🙂 | Try splitting into smaller methods |
| particula/particle.py | Particle.\_coag\_prep | 0 ⭐ | 39 ⭐ | 13 😞 | 73.07% 🙂 | Extract out complex expressions |
| particula/particle.py | ParticleCondensation.vapor\_flux | 0 ⭐ | 37 ⭐ | 10 😞 | 78.59% ⭐ | Extract out complex expressions |

## Legend and Explanation

The emojis denote the absolute quality of the code:

 - ⭐ excellent
 - 🙂 good
 - 😞 poor
 - ⛔ very poor


The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.

***

Please see our documentation [here](https://docs.sourcery.ai/GitHub/Quality-Report/) for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Help us [improve](https://research.typeform.com/to/j06Spdfr?type=quality_report&github_login=ngam&base_repo=https%3A%2F%2Fgithub.com%2Funcscode%2Fparticula.git&base_remote_ref=refs%2Fpull%2F208%2Fhead&base_ref=main&base_sha=c4b073b8b423cfb7e15e73cfcefe9d9b297d0a72&head_repo=https%3A%2F%2Fgithub.com%2Funcscode%2Fparticula.git&head_ref=sourcery%2Fpull-208&base_pr_number=208&base_pr_state=open) this quality report!
sourcery-ai[bot]: # Sourcery Code Quality Report

❌ &nbsp;Merging this PR will **decrease** code quality in the affected files by **4.07%**.

| Quality metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| [Complexity](https://docs.sourcery.ai/GitHub/Quality-Report/#complexity) | 0.92 ⭐ | 0.79 ⭐ | -0.13 👍 |
| [Method Length](https://docs.sourcery.ai/GitHub/Quality-Report/#method-length) | 33.09 ⭐ | 42.84 ⭐ | 9.75 👎 |
| [Working memory](https://docs.sourcery.ai/GitHub/Quality-Report/#working-memory) | 6.92 🙂 | 7.76 🙂 | 0.84 👎 |
| **[Quality](https://docs.sourcery.ai/GitHub/Quality-Report/#quality-score)** | **82.12%** ⭐| **78.05%** ⭐| **-4.07%** 👎 |

| Other metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| Lines | 422 | 510 | 88 |

| Changed files | Quality Before | Quality After | Quality Change |
| --- | :---: | :---: | :---: |
| particula/particle.py | 85.60% ⭐ | 84.41% ⭐ | -1.19% 👎|
| particula/util/distribution_discretization.py | 64.84% 🙂 | 51.58% 🙂 | -13.26% 👎|
| particula/util/radius_cutoff.py | 79.03% ⭐ | 62.95% 🙂 | -16.08% 👎|
| particula/util/tests/distribution_discretization_test.py | 77.32% ⭐ | 77.17% ⭐ | -0.15% 👎|
| particula/util/tests/radius_cutoff_test.py | 75.72% ⭐ | 70.76% 🙂 | -4.96% 👎|

Here are some functions in these files that still need a tune-up:

| File | Function | Complexity | Length | Working Memory | Quality | Recommendation |
| --- | --- | :---: | :---: | :---: | :---: | --- |
| particula/util/distribution_discretization.py | discretize | 3 ⭐ | 144 😞 | 16 ⛔ | 51.58% 🙂 | Try splitting into smaller methods. Extract out complex expressions |
| particula/util/radius_cutoff.py | cut\_rad | 2 ⭐ | 82 🙂 | 14 😞 | 62.95% 🙂 | Extract out complex expressions |
| particula/particle.py | ParticleDistribution.pre\_radius | 3 ⭐ | 95 🙂 | 12 😞 | 63.07% 🙂 | Extract out complex expressions |
| particula/util/tests/radius_cutoff_test.py | test\_multi\_cuts | 0 ⭐ | 208 ⛔ | 6 ⭐ | 66.90% 🙂 | Try splitting into smaller methods |
| particula/particle.py | Particle.\_coag\_prep | 0 ⭐ | 39 ⭐ | 13 😞 | 73.07% 🙂 | Extract out complex expressions |

## Legend and Explanation

The emojis denote the absolute quality of the code:

 - ⭐ excellent
 - 🙂 good
 - 😞 poor
 - ⛔ very poor


The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.

***

Please see our documentation [here](https://docs.sourcery.ai/GitHub/Quality-Report/) for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Help us [improve](https://research.typeform.com/to/j06Spdfr?type=quality_report&github_login=ngam&base_repo=https%3A%2F%2Fgithub.com%2Funcscode%2Fparticula.git&base_remote_ref=refs%2Fpull%2F208%2Fhead&base_ref=main&base_sha=de678c7d85fd12b8517410d65d35871c44b154a6&head_repo=https%3A%2F%2Fgithub.com%2Funcscode%2Fparticula.git&head_ref=sourcery%2Fpull-208&base_pr_number=208&base_pr_state=open) this quality report!
sourcery-ai[bot]: # Sourcery Code Quality Report

❌ &nbsp;Merging this PR will **decrease** code quality in the affected files by **4.07%**.

| Quality metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| [Complexity](https://docs.sourcery.ai/GitHub/Quality-Report/#complexity) | 0.92 ⭐ | 0.79 ⭐ | -0.13 👍 |
| [Method Length](https://docs.sourcery.ai/GitHub/Quality-Report/#method-length) | 33.09 ⭐ | 42.84 ⭐ | 9.75 👎 |
| [Working memory](https://docs.sourcery.ai/GitHub/Quality-Report/#working-memory) | 6.92 🙂 | 7.76 🙂 | 0.84 👎 |
| **[Quality](https://docs.sourcery.ai/GitHub/Quality-Report/#quality-score)** | **82.12%** ⭐| **78.05%** ⭐| **-4.07%** 👎 |

| Other metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| Lines | 422 | 512 | 90 |

| Changed files | Quality Before | Quality After | Quality Change |
| --- | :---: | :---: | :---: |
| particula/particle.py | 85.60% ⭐ | 84.41% ⭐ | -1.19% 👎|
| particula/util/distribution_discretization.py | 64.84% 🙂 | 51.58% 🙂 | -13.26% 👎|
| particula/util/radius_cutoff.py | 79.03% ⭐ | 62.95% 🙂 | -16.08% 👎|
| particula/util/tests/distribution_discretization_test.py | 77.32% ⭐ | 77.17% ⭐ | -0.15% 👎|
| particula/util/tests/radius_cutoff_test.py | 75.72% ⭐ | 70.76% 🙂 | -4.96% 👎|

Here are some functions in these files that still need a tune-up:

| File | Function | Complexity | Length | Working Memory | Quality | Recommendation |
| --- | --- | :---: | :---: | :---: | :---: | --- |
| particula/util/distribution_discretization.py | discretize | 3 ⭐ | 144 😞 | 16 ⛔ | 51.58% 🙂 | Try splitting into smaller methods. Extract out complex expressions |
| particula/util/radius_cutoff.py | cut\_rad | 2 ⭐ | 82 🙂 | 14 😞 | 62.95% 🙂 | Extract out complex expressions |
| particula/particle.py | ParticleDistribution.pre\_radius | 3 ⭐ | 95 🙂 | 12 😞 | 63.07% 🙂 | Extract out complex expressions |
| particula/util/tests/radius_cutoff_test.py | test\_multi\_cuts | 0 ⭐ | 208 ⛔ | 6 ⭐ | 66.90% 🙂 | Try splitting into smaller methods |
| particula/particle.py | Particle.\_coag\_prep | 0 ⭐ | 39 ⭐ | 13 😞 | 73.07% 🙂 | Extract out complex expressions |

## Legend and Explanation

The emojis denote the absolute quality of the code:

 - ⭐ excellent
 - 🙂 good
 - 😞 poor
 - ⛔ very poor


The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.

***

Please see our documentation [here](https://docs.sourcery.ai/GitHub/Quality-Report/) for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Help us [improve](https://research.typeform.com/to/j06Spdfr?type=quality_report&github_login=ngam&base_repo=https%3A%2F%2Fgithub.com%2Funcscode%2Fparticula.git&base_remote_ref=refs%2Fpull%2F208%2Fhead&base_ref=main&base_sha=ddff338d659ba247e452300f0d35e36a5dac74ac&head_repo=https%3A%2F%2Fgithub.com%2Funcscode%2Fparticula.git&head_ref=sourcery%2Fpull-208&base_pr_number=208&base_pr_state=open) this quality report!
sourcery-ai[bot]: # Sourcery Code Quality Report

❌ &nbsp;Merging this PR will **decrease** code quality in the affected files by **3.50%**.

| Quality metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| [Complexity](https://docs.sourcery.ai/GitHub/Quality-Report/#complexity) | 0.92 ⭐ | 0.79 ⭐ | -0.13 👍 |
| [Method Length](https://docs.sourcery.ai/GitHub/Quality-Report/#method-length) | 33.09 ⭐ | 41.97 ⭐ | 8.88 👎 |
| [Working memory](https://docs.sourcery.ai/GitHub/Quality-Report/#working-memory) | 6.92 🙂 | 7.60 🙂 | 0.68 👎 |
| **[Quality](https://docs.sourcery.ai/GitHub/Quality-Report/#quality-score)** | **82.12%** ⭐| **78.62%** ⭐| **-3.50%** 👎 |

| Other metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| Lines | 422 | 510 | 88 |

| Changed files | Quality Before | Quality After | Quality Change |
| --- | :---: | :---: | :---: |
| particula/particle.py | 85.60% ⭐ | 85.34% ⭐ | -0.26% 👎|
| particula/util/distribution_discretization.py | 64.84% 🙂 | 51.58% 🙂 | -13.26% 👎|
| particula/util/radius_cutoff.py | 79.03% ⭐ | 62.95% 🙂 | -16.08% 👎|
| particula/util/tests/distribution_discretization_test.py | 77.32% ⭐ | 77.17% ⭐ | -0.15% 👎|
| particula/util/tests/radius_cutoff_test.py | 75.72% ⭐ | 70.76% 🙂 | -4.96% 👎|

Here are some functions in these files that still need a tune-up:

| File | Function | Complexity | Length | Working Memory | Quality | Recommendation |
| --- | --- | :---: | :---: | :---: | :---: | --- |
| particula/util/distribution_discretization.py | discretize | 3 ⭐ | 144 😞 | 16 ⛔ | 51.58% 🙂 | Try splitting into smaller methods. Extract out complex expressions |
| particula/util/radius_cutoff.py | cut\_rad | 2 ⭐ | 82 🙂 | 14 😞 | 62.95% 🙂 | Extract out complex expressions |
| particula/util/tests/radius_cutoff_test.py | test\_multi\_cuts | 0 ⭐ | 208 ⛔ | 6 ⭐ | 66.90% 🙂 | Try splitting into smaller methods |
| particula/particle.py | Particle.\_coag\_prep | 0 ⭐ | 39 ⭐ | 13 😞 | 73.07% 🙂 | Extract out complex expressions |
| particula/particle.py | ParticleCondensation.vapor\_flux | 0 ⭐ | 37 ⭐ | 10 😞 | 78.59% ⭐ | Extract out complex expressions |

## Legend and Explanation

The emojis denote the absolute quality of the code:

 - ⭐ excellent
 - 🙂 good
 - 😞 poor
 - ⛔ very poor


The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.

***

Please see our documentation [here](https://docs.sourcery.ai/GitHub/Quality-Report/) for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Help us [improve](https://research.typeform.com/to/j06Spdfr?type=quality_report&github_login=ngam&base_repo=https%3A%2F%2Fgithub.com%2Funcscode%2Fparticula.git&base_remote_ref=refs%2Fpull%2F208%2Fhead&base_ref=main&base_sha=a527deb1407bf2c2a3f41352326e7bbaf8f4faa0&head_repo=https%3A%2F%2Fgithub.com%2Funcscode%2Fparticula.git&head_ref=sourcery%2Fpull-208&base_pr_number=208&base_pr_state=open) this quality report!
ngam: @Gorkowski this is more or less ready, could you have a look and think of an appropriate test?
ngam: To clarify, a test or two are needed in particle_test.py.
sourcery-ai[bot]: # Sourcery Code Quality Report

❌ &nbsp;Merging this PR will **decrease** code quality in the affected files by **1.96%**.

| Quality metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| [Complexity](https://docs.sourcery.ai/GitHub/Quality-Report/#complexity) | 0.56 ⭐ | 0.48 ⭐ | -0.08 👍 |
| [Method Length](https://docs.sourcery.ai/GitHub/Quality-Report/#method-length) | 43.79 ⭐ | 50.47 ⭐ | 6.68 👎 |
| [Working memory](https://docs.sourcery.ai/GitHub/Quality-Report/#working-memory) | 6.82 🙂 | 7.21 🙂 | 0.39 👎 |
| **[Quality](https://docs.sourcery.ai/GitHub/Quality-Report/#quality-score)** | **80.01%** ⭐| **78.05%** ⭐| **-1.96%** 👎 |

| Other metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| Lines | 670 | 808 | 138 |

| Changed files | Quality Before | Quality After | Quality Change |
| --- | :---: | :---: | :---: |
| particula/particle.py | 85.60% ⭐ | 85.34% ⭐ | -0.26% 👎|
| particula/tests/particle_test.py | 76.73% ⭐ | 77.17% ⭐ | 0.44% 👍|
| particula/util/distribution_discretization.py | 64.84% 🙂 | 51.58% 🙂 | -13.26% 👎|
| particula/util/radius_cutoff.py | 79.03% ⭐ | 62.95% 🙂 | -16.08% 👎|
| particula/util/tests/distribution_discretization_test.py | 77.32% ⭐ | 77.17% ⭐ | -0.15% 👎|
| particula/util/tests/radius_cutoff_test.py | 75.72% ⭐ | 70.76% 🙂 | -4.96% 👎|

Here are some functions in these files that still need a tune-up:

| File | Function | Complexity | Length | Working Memory | Quality | Recommendation |
| --- | --- | :---: | :---: | :---: | :---: | --- |
| particula/util/distribution_discretization.py | discretize | 3 ⭐ | 144 😞 | 16 ⛔ | 51.58% 🙂 | Try splitting into smaller methods. Extract out complex expressions |
| particula/util/radius_cutoff.py | cut\_rad | 2 ⭐ | 82 🙂 | 14 😞 | 62.95% 🙂 | Extract out complex expressions |
| particula/tests/particle_test.py | test\_multiple\_shapes | 0 ⭐ | 280 ⛔ | 6 ⭐ | 63.02% 🙂 | Try splitting into smaller methods |
| particula/util/tests/radius_cutoff_test.py | test\_multi\_cuts | 0 ⭐ | 208 ⛔ | 6 ⭐ | 66.90% 🙂 | Try splitting into smaller methods |
| particula/tests/particle_test.py | test\_condensation\_stuff | 0 ⭐ | 156 😞 | 7 🙂 | 68.91% 🙂 | Try splitting into smaller methods |

## Legend and Explanation

The emojis denote the absolute quality of the code:

 - ⭐ excellent
 - 🙂 good
 - 😞 poor
 - ⛔ very poor


The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.

***

Please see our documentation [here](https://docs.sourcery.ai/GitHub/Quality-Report/) for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Help us [improve](https://research.typeform.com/to/j06Spdfr?type=quality_report&github_login=ngam&base_repo=https%3A%2F%2Fgithub.com%2Funcscode%2Fparticula.git&base_remote_ref=refs%2Fpull%2F208%2Fhead&base_ref=main&base_sha=edc11156adab3ea4c429501e16949a5f6ee9941e&head_repo=https%3A%2F%2Fgithub.com%2Funcscode%2Fparticula.git&head_ref=sourcery%2Fpull-208&base_pr_number=208&base_pr_state=open) this quality report!
sourcery-ai[bot]: # Sourcery Code Quality Report

❌ &nbsp;Merging this PR will **decrease** code quality in the affected files by **1.96%**.

| Quality metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| [Complexity](https://docs.sourcery.ai/GitHub/Quality-Report/#complexity) | 0.56 ⭐ | 0.48 ⭐ | -0.08 👍 |
| [Method Length](https://docs.sourcery.ai/GitHub/Quality-Report/#method-length) | 43.79 ⭐ | 50.47 ⭐ | 6.68 👎 |
| [Working memory](https://docs.sourcery.ai/GitHub/Quality-Report/#working-memory) | 6.82 🙂 | 7.21 🙂 | 0.39 👎 |
| **[Quality](https://docs.sourcery.ai/GitHub/Quality-Report/#quality-score)** | **80.01%** ⭐| **78.05%** ⭐| **-1.96%** 👎 |

| Other metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| Lines | 670 | 808 | 138 |

| Changed files | Quality Before | Quality After | Quality Change |
| --- | :---: | :---: | :---: |
| particula/particle.py | 85.60% ⭐ | 85.34% ⭐ | -0.26% 👎|
| particula/tests/particle_test.py | 76.73% ⭐ | 77.17% ⭐ | 0.44% 👍|
| particula/util/distribution_discretization.py | 64.84% 🙂 | 51.58% 🙂 | -13.26% 👎|
| particula/util/radius_cutoff.py | 79.03% ⭐ | 62.95% 🙂 | -16.08% 👎|
| particula/util/tests/distribution_discretization_test.py | 77.32% ⭐ | 77.17% ⭐ | -0.15% 👎|
| particula/util/tests/radius_cutoff_test.py | 75.72% ⭐ | 70.76% 🙂 | -4.96% 👎|

Here are some functions in these files that still need a tune-up:

| File | Function | Complexity | Length | Working Memory | Quality | Recommendation |
| --- | --- | :---: | :---: | :---: | :---: | --- |
| particula/util/distribution_discretization.py | discretize | 3 ⭐ | 144 😞 | 16 ⛔ | 51.58% 🙂 | Try splitting into smaller methods. Extract out complex expressions |
| particula/util/radius_cutoff.py | cut\_rad | 2 ⭐ | 82 🙂 | 14 😞 | 62.95% 🙂 | Extract out complex expressions |
| particula/tests/particle_test.py | test\_multiple\_shapes | 0 ⭐ | 280 ⛔ | 6 ⭐ | 63.02% 🙂 | Try splitting into smaller methods |
| particula/util/tests/radius_cutoff_test.py | test\_multi\_cuts | 0 ⭐ | 208 ⛔ | 6 ⭐ | 66.90% 🙂 | Try splitting into smaller methods |
| particula/tests/particle_test.py | test\_condensation\_stuff | 0 ⭐ | 156 😞 | 7 🙂 | 68.91% 🙂 | Try splitting into smaller methods |

## Legend and Explanation

The emojis denote the absolute quality of the code:

 - ⭐ excellent
 - 🙂 good
 - 😞 poor
 - ⛔ very poor


The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.

***

Please see our documentation [here](https://docs.sourcery.ai/GitHub/Quality-Report/) for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Help us [improve](https://research.typeform.com/to/j06Spdfr?type=quality_report&github_login=ngam&base_repo=https%3A%2F%2Fgithub.com%2Funcscode%2Fparticula.git&base_remote_ref=refs%2Fpull%2F208%2Fhead&base_ref=main&base_sha=d697f0ea0f5713645dddd1f766509b76e9b0b9ae&head_repo=https%3A%2F%2Fgithub.com%2Funcscode%2Fparticula.git&head_ref=sourcery%2Fpull-208&base_pr_number=208&base_pr_state=open) this quality report!
sourcery-ai[bot]: # Sourcery Code Quality Report

❌ &nbsp;Merging this PR will **decrease** code quality in the affected files by **1.75%**.

| Quality metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| [Complexity](https://docs.sourcery.ai/GitHub/Quality-Report/#complexity) | 0.56 ⭐ | 0.48 ⭐ | -0.08 👍 |
| [Method Length](https://docs.sourcery.ai/GitHub/Quality-Report/#method-length) | 43.79 ⭐ | 50.47 ⭐ | 6.68 👎 |
| [Working memory](https://docs.sourcery.ai/GitHub/Quality-Report/#working-memory) | 6.82 🙂 | 7.13 🙂 | 0.31 👎 |
| **[Quality](https://docs.sourcery.ai/GitHub/Quality-Report/#quality-score)** | **80.01%** ⭐| **78.26%** ⭐| **-1.75%** 👎 |

| Other metrics | Before | After | Change |
| --- | :---: | :---: | :---: |
| Lines | 670 | 804 | 134 |

| Changed files | Quality Before | Quality After | Quality Change |
| --- | :---: | :---: | :---: |
| particula/particle.py | 85.60% ⭐ | 85.34% ⭐ | -0.26% 👎|
| particula/tests/particle_test.py | 76.73% ⭐ | 77.69% ⭐ | 0.96% 👍|
| particula/util/distribution_discretization.py | 64.84% 🙂 | 51.58% 🙂 | -13.26% 👎|
| particula/util/radius_cutoff.py | 79.03% ⭐ | 62.95% 🙂 | -16.08% 👎|
| particula/util/tests/distribution_discretization_test.py | 77.32% ⭐ | 77.17% ⭐ | -0.15% 👎|
| particula/util/tests/radius_cutoff_test.py | 75.72% ⭐ | 70.76% 🙂 | -4.96% 👎|

Here are some functions in these files that still need a tune-up:

| File | Function | Complexity | Length | Working Memory | Quality | Recommendation |
| --- | --- | :---: | :---: | :---: | :---: | --- |
| particula/util/distribution_discretization.py | discretize | 3 ⭐ | 144 😞 | 16 ⛔ | 51.58% 🙂 | Try splitting into smaller methods. Extract out complex expressions |
| particula/util/radius_cutoff.py | cut\_rad | 2 ⭐ | 82 🙂 | 14 😞 | 62.95% 🙂 | Extract out complex expressions |
| particula/tests/particle_test.py | test\_multiple\_shapes | 0 ⭐ | 280 ⛔ | 6 ⭐ | 63.02% 🙂 | Try splitting into smaller methods |
| particula/util/tests/radius_cutoff_test.py | test\_multi\_cuts | 0 ⭐ | 208 ⛔ | 6 ⭐ | 66.90% 🙂 | Try splitting into smaller methods |
| particula/tests/particle_test.py | test\_condensation\_stuff | 0 ⭐ | 156 😞 | 7 🙂 | 68.91% 🙂 | Try splitting into smaller methods |

## Legend and Explanation

The emojis denote the absolute quality of the code:

 - ⭐ excellent
 - 🙂 good
 - 😞 poor
 - ⛔ very poor


The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.

***

Please see our documentation [here](https://docs.sourcery.ai/GitHub/Quality-Report/) for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Help us [improve](https://research.typeform.com/to/j06Spdfr?type=quality_report&github_login=ngam&base_repo=https%3A%2F%2Fgithub.com%2Funcscode%2Fparticula.git&base_remote_ref=refs%2Fpull%2F208%2Fhead&base_ref=main&base_sha=946d4914302067a40540161824a1b09b382c8077&head_repo=https%3A%2F%2Fgithub.com%2Funcscode%2Fparticula.git&head_ref=sourcery%2Fpull-208&base_pr_number=208&base_pr_state=open) this quality report!

Patch:
diff --git a/particula/particle.py b/particula/particle.py
index 3b9e2f75a..8e85fd238 100644
--- a/particula/particle.py
+++ b/particula/particle.py
@@ -35,7 +35,7 @@ class ParticleDistribution(Vapor):
 
         self.spacing = kwargs.get("spacing", "linspace")
         self.nbins = in_scalar(kwargs.get("nbins", 1000)).m
-        self.nparticles = in_scalar(kwargs.get("nparticles", 1e5))
+        self.nparticles = in_scalar(kwargs.get("nparticles", 1e5)).m
         self.volume = in_volume(kwargs.get("volume", 1e-6))
         self.cutoff = in_scalar(kwargs.get("cutoff", 0.9999)).m
         self.gsigma = in_scalar(kwargs.get("gsigma", 1.25)).m
@@ -89,7 +89,8 @@ class ParticleDistribution(Vapor):
             interval=self.pre_radius(),
             disttype="lognormal",
             gsigma=self.gsigma,
-            mode=self.mode
+            mode=self.mode,
+            nparticles=self.nparticles
         )
 
     def pre_distribution(self):
@@ -102,7 +103,9 @@ class ParticleDistribution(Vapor):
                 mode    : geometric mean radius of the particles
         """
 
-        return self.nparticles*self.pre_discretize()/self.volume
+        return np.array(
+            [self.nparticles]
+        ).sum()*self.pre_discretize()/self.volume
 
 
 class ParticleInstances(ParticleDistribution):
diff --git a/particula/util/distribution_discretization.py b/particula/util/distribution_discretization.py
index 76facea50..93a8e43fd 100644
--- a/particula/util/distribution_discretization.py
+++ b/particula/util/distribution_discretization.py
@@ -11,6 +11,7 @@ def discretize(
     disttype="lognormal",
     gsigma=in_scalar(1.25).m,
     mode=in_radius(100e-9).m,
+    nparticles=in_scalar(1e5).m,
     **kwargs
 ):
     """ discretize the distribution of the particles
@@ -30,13 +31,17 @@ def discretize(
     if not isinstance(interval, u.Quantity):
         interval = u.Quantity(interval, " ")
 
-    if disttype == "lognormal":
-        dist = lognorm.pdf(
-            x=interval.m,
-            s=np.log(gsigma),
-            scale=mode,
-        )/interval.u
-    else:
+    if disttype != "lognormal":
         raise ValueError("the 'disttype' must be 'lognormal' for now!")
 
-    return dist
+    return ((
+        lognorm.pdf(
+            x=interval.m,
+            s=np.reshape(np.log(gsigma), (np.array([gsigma]).size, 1)),
+            scale=np.reshape([mode], (np.array([mode]).size, 1)),
+        ) / interval.u
+        * np.reshape([nparticles], (np.array([nparticles]).size, 1))
+        ).sum(axis=0) /
+        np.array([nparticles]).sum() /
+        np.max([np.array([mode]).size, np.array([gsigma]).size])
+    )
diff --git a/particula/util/radius_cutoff.py b/particula/util/radius_cutoff.py
index 221204629..346ce668b 100644
--- a/particula/util/radius_cutoff.py
+++ b/particula/util/radius_cutoff.py
@@ -26,10 +26,19 @@ def cut_rad(
 
     _ = kwargs.get("something", None)
 
-    (rad_start, rad_end) = lognorm.interval(
-        alpha=cutoff,
-        s=np.log(gsigma),
-        scale=mode,
-    )
+    if np.array([mode]).size == 1:
+        (rad_start, rad_end) = lognorm.interval(
+            alpha=cutoff,
+            s=np.log(gsigma),
+            scale=mode,
+        )
+    else:
+        (rad_start_pre, rad_end_pre) = lognorm.interval(
+            alpha=cutoff,
+            s=np.log(gsigma),
+            scale=mode,
+        )
+        rad_start = rad_start_pre.min()
+        rad_end = rad_end_pre.max()
 
     return (rad_start, rad_end)


Test patch:
diff --git a/particula/tests/particle_test.py b/particula/tests/particle_test.py
index 81fb0ceba..194b44110 100644
--- a/particula/tests/particle_test.py
+++ b/particula/tests/particle_test.py
@@ -49,6 +49,52 @@ standard_environment_ip = environment.Environment(
     pressure=101325 * u.Pa,
 )
 
+single_mode = {
+    "mode": 500e-9,  # 500 nm median
+    "nbins": 1000,  # 1000 bins
+    "nparticles": 1e6,  # 1e4 #
+    "volume": 1e-6,  # per 1e-6 m^3 (or 1 cc)
+    "gsigma": 1.5,  # relatively narrow
+    "spacing": "linspace",  # bin spacing,
+}
+
+multi_mode = {
+    "mode": [500e-9, 500e-9],  # 500 nm median
+    "nbins": 1000,  # 1000 bins
+    "nparticles": [1e6, 1e6],  # 1e4 #
+    "volume": 1e-6,  # per 1e-6 m^3 (or 1 cc)
+    "gsigma": [1.2, 1.2],  # relatively narrow
+    "spacing": "linspace",  # bin spacing,
+}
+
+
+def test_particle_distribution():
+    """"Test that the particle distribution is calculated for single mode and
+    multi mode.
+    """
+    def pdf_total(radius, pdf_distribution):
+        return np.trapz(y=pdf_distribution, x=radius)
+
+    # single mode
+    particle_distribution_1 = particle.ParticleDistribution(
+        **single_mode
+    )
+    total_number = pdf_total(
+        particle_distribution_1.pre_radius().m,
+        particle_distribution_1.pre_distribution().m,
+    )
+    assert total_number == pytest.approx(1e12, rel=1e10)
+
+    # multi mode
+    particle_distribution_2 = particle.ParticleDistribution(
+        **multi_mode
+    )
+    total_number2 = pdf_total(
+        particle_distribution_2.pre_radius().m,
+        particle_distribution_2.pre_distribution().m
+    )
+    assert total_number2 == pytest.approx(2e12, rel=1e10)
+
 
 def test_getters():
     """Test that the getters work.
diff --git a/particula/util/tests/distribution_discretization_test.py b/particula/util/tests/distribution_discretization_test.py
index 7c88d68e9..c99c5becc 100644
--- a/particula/util/tests/distribution_discretization_test.py
+++ b/particula/util/tests/distribution_discretization_test.py
@@ -26,3 +26,25 @@ def test_discretize():
         discretize(
             interval=spans, disttype="linear", gsigma=sigma, mode=modes,
         )
+
+
+def test_multi_discretize():
+    """ testing different modes
+    """
+
+    spans = np.linspace(1, 1000, 1000)
+    sigma = 1.25
+    modes = [100, 200]
+
+    assert discretize(
+        interval=spans, disttype="lognormal", gsigma=sigma, mode=modes
+    ).size == spans.size
+
+    assert np.trapz(discretize(
+        interval=spans, disttype="lognormal", gsigma=sigma, mode=modes
+    ), spans) == pytest.approx(1, rel=1e-5)
+
+    with pytest.raises(ValueError):
+        discretize(
+            interval=spans, disttype="linear", gsigma=sigma, mode=modes,
+        )
diff --git a/particula/util/tests/radius_cutoff_test.py b/particula/util/tests/radius_cutoff_test.py
index ae517142d..72773d8a5 100644
--- a/particula/util/tests/radius_cutoff_test.py
+++ b/particula/util/tests/radius_cutoff_test.py
@@ -41,3 +41,56 @@ def test_cuts():
         <=
         cut_rad(cutoff=.9999, gsigma=1.35, mode=1e-7)[1]
     )
+
+
+def test_multi_cuts():
+    """ test case for different modes
+    """
+
+    assert (
+        cut_rad(cutoff=.9999, gsigma=1.25, mode=[1e-7, 1e-8])[0]
+        <=
+        cut_rad(cutoff=.9999, gsigma=1.25, mode=[1e-7, 1e-8])[1]
+    )
+
+    assert (
+        cut_rad(cutoff=.9999, gsigma=1.25, mode=[1e-7, 1e-8])[0]
+        <=
+        cut_rad(cutoff=.9990, gsigma=1.25, mode=[1e-7, 1e-8])[0]
+    )
+
+    assert (
+        cut_rad(cutoff=.9999, gsigma=1.25, mode=[1e-7, 1e-8])[1]
+        >=
+        cut_rad(cutoff=.9990, gsigma=1.25, mode=[1e-7, 1e-8])[1]
+    )
+
+    assert (
+        cut_rad(cutoff=.9999, gsigma=1.25, mode=[1e-7, 1e-8])[1]
+        <=
+        cut_rad(cutoff=.9999, gsigma=1.25, mode=[1e-7, 1e-8])[1]
+    )
+
+    assert (
+        cut_rad(cutoff=.9999, gsigma=1.25, mode=[1e-7, 1e-8])[1]
+        ==
+        cut_rad(cutoff=.9999, gsigma=1.25, mode=[1e-7])[1]
+    )
+
+    assert (
+        cut_rad(cutoff=.9999, gsigma=1.25, mode=[1e-7, 1e-8])[1]
+        >=
+        cut_rad(cutoff=.9999, gsigma=1.25, mode=[1e-8])[1]
+    )
+
+    assert (
+        cut_rad(cutoff=.9999, gsigma=1.25, mode=[1e-7, 1e-8])[0]
+        ==
+        cut_rad(cutoff=.9999, gsigma=1.25, mode=[1e-8])[0]
+    )
+
+    assert (
+        cut_rad(cutoff=.9999, gsigma=1.25, mode=[1e-7, 1e-8])[0]
+        <=
+        cut_rad(cutoff=.9999, gsigma=1.25, mode=[1e-7])[0]
+    )