Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Allow usage of subfolders in project API for parameters, models and data #1232

Merged
merged 4 commits into from
Feb 10, 2023

Conversation

s-weigand
Copy link
Member

@s-weigand s-weigand commented Feb 10, 2023

This change allows using of files in subfolders for (parameters, models and data) with the project API.
It handles the ambiguity of files (same file name different extensions next to each other) gracefully by creating unique names and warning the user.

Change summary

Checklist

  • ✔️ Passing the tests (mandatory for all PR's)
  • 🚧 Added changes to changelog (mandatory for all PR's)
  • 🧪 Adds new tests for the feature (mandatory for ✨ feature and 🩹 bug fix PR's)

@s-weigand s-weigand requested a review from jsnel as a code owner February 10, 2023 18:37
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Feb 10, 2023

Sourcery Code Quality Report

❌  Merging this PR will decrease code quality in the affected files by 1.35%.

Quality metrics Before After Change
Complexity 1.15 ⭐ 1.27 ⭐ 0.12 👎
Method Length 58.95 ⭐ 62.86 🙂 3.91 👎
Working memory 6.67 🙂 6.87 🙂 0.20 👎
Quality 76.84% 75.49% -1.35% 👎
Other metrics Before After Change
Lines 1507 1661 154
Changed files Quality Before Quality After Quality Change
glotaran/project/project.py 82.79% ⭐ 83.40% ⭐ 0.61% 👍
glotaran/project/project_data_registry.py 74.46% 🙂 74.38% 🙂 -0.08% 👎
glotaran/project/project_model_registry.py 76.47% ⭐ 76.37% ⭐ -0.10% 👎
glotaran/project/project_parameter_registry.py 65.83% 🙂 65.74% 🙂 -0.09% 👎
glotaran/project/project_registry.py 89.44% ⭐ 76.65% ⭐ -12.79% 👎
glotaran/project/project_result_registry.py 81.61% ⭐ 81.58% ⭐ -0.03% 👎
glotaran/project/test/test_project.py 73.18% 🙂 72.64% 🙂 -0.54% 👎

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

File Function Complexity Length Working Memory Quality Recommendation
glotaran/project/test/test_project.py test_generate_parameters 3 ⭐ 213 ⛔ 9 🙂 56.54% 🙂 Try splitting into smaller methods
glotaran/project/project_registry.py AmbiguousNameWarning.__init__ 0 ⭐ 91 🙂 18 ⛔ 59.40% 🙂 Extract out complex expressions
glotaran/project/project_parameter_registry.py ProjectParameterRegistry.generate_parameters 8 ⭐ 113 🙂 10 😞 59.42% 🙂 Extract out complex expressions
glotaran/project/project_registry.py ProjectRegistry.items 7 ⭐ 115 🙂 10 😞 60.12% 🙂 Extract out complex expressions
glotaran/project/test/test_project.py test_missing_file_errors 0 ⭐ 220 ⛔ 8 🙂 61.27% 🙂 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 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 this quality report!

@github-actions
Copy link
Contributor

Binder 👈 Launch a binder notebook on branch s-weigand/pyglotaran/project-allow-nested-dir

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@github-actions
Copy link
Contributor

github-actions bot commented Feb 10, 2023

Benchmark is done. Checkout the benchmark result page.
Benchmark differences below 5% might be due to CI noise.

Benchmark diff v0.6.0 vs. main

Parametrized benchmark signatures:

BenchmarkOptimize.time_optimize(index_dependent, grouped, weight)

All benchmarks:

       before           after         ratio
     [6c3c390e]       [bb4ef933]
     <v0.6.0>                   
!      42.0±0.2ms           failed      n/a  BenchmarkOptimize.time_optimize(False, False, False)
!      44.8±0.3ms           failed      n/a  BenchmarkOptimize.time_optimize(False, False, True)
!      42.0±0.2ms           failed      n/a  BenchmarkOptimize.time_optimize(False, True, False)
!        45.1±1ms           failed      n/a  BenchmarkOptimize.time_optimize(False, True, True)
!      52.3±0.3ms           failed      n/a  BenchmarkOptimize.time_optimize(True, False, False)
!       68.5±30ms           failed      n/a  BenchmarkOptimize.time_optimize(True, False, True)
!      52.2±0.2ms           failed      n/a  BenchmarkOptimize.time_optimize(True, True, False)
!        60.2±2ms           failed      n/a  BenchmarkOptimize.time_optimize(True, True, True)
             201M             206M     1.02  IntegrationTwoDatasets.peakmem_optimize
-      1.90±0.06s       1.03±0.04s     0.54  IntegrationTwoDatasets.time_optimize

Benchmark diff main vs. PR

Parametrized benchmark signatures:

BenchmarkOptimize.time_optimize(index_dependent, grouped, weight)

All benchmarks:

       before           after         ratio
     [bb4ef933]       [9cc3c343]
           failed           failed      n/a  BenchmarkOptimize.time_optimize(False, False, False)
           failed           failed      n/a  BenchmarkOptimize.time_optimize(False, False, True)
           failed           failed      n/a  BenchmarkOptimize.time_optimize(False, True, False)
           failed           failed      n/a  BenchmarkOptimize.time_optimize(False, True, True)
           failed           failed      n/a  BenchmarkOptimize.time_optimize(True, False, False)
           failed           failed      n/a  BenchmarkOptimize.time_optimize(True, False, True)
           failed           failed      n/a  BenchmarkOptimize.time_optimize(True, True, False)
           failed           failed      n/a  BenchmarkOptimize.time_optimize(True, True, True)
             206M             208M     1.01  IntegrationTwoDatasets.peakmem_optimize
       1.03±0.04s       1.02±0.03s     0.99  IntegrationTwoDatasets.time_optimize

@codecov
Copy link

codecov bot commented Feb 10, 2023

Codecov Report

Base: 87.9% // Head: 87.9% // Increases project coverage by +0.0% 🎉

Coverage data is based on head (9cc3c34) compared to base (bb4ef93).
Patch coverage: 100.0% of modified lines in pull request are covered.

Additional details and impacted files
@@          Coverage Diff          @@
##            main   #1232   +/-   ##
=====================================
  Coverage   87.9%   87.9%           
=====================================
  Files        104     104           
  Lines       5004    5010    +6     
  Branches     830     833    +3     
=====================================
+ Hits        4401    4407    +6     
  Misses       487     487           
  Partials     116     116           
Impacted Files Coverage Δ
glotaran/project/project_data_registry.py 100.0% <ø> (ø)
glotaran/project/project_model_registry.py 100.0% <ø> (ø)
glotaran/project/project_parameter_registry.py 95.8% <ø> (ø)
glotaran/project/project_result_registry.py 100.0% <ø> (ø)
glotaran/project/project.py 100.0% <100.0%> (ø)
glotaran/project/project_registry.py 96.0% <100.0%> (+1.6%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Member

@jsnel jsnel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good quality of life improvement.

@s-weigand s-weigand added this pull request to the merge queue Feb 10, 2023
Merged via the queue into glotaran:main with commit bcf7cc2 Feb 10, 2023
@s-weigand s-weigand deleted the project-allow-nested-dir branch February 10, 2023 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants