-
Notifications
You must be signed in to change notification settings - Fork 18
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
✨ Project Class #869
✨ Project Class #869
Conversation
SonarCloud Quality Gate failed.
|
Codecov Report
@@ Coverage Diff @@
## main #869 +/- ##
=======================================
+ Coverage 86.0% 86.9% +0.8%
=======================================
Files 92 99 +7
Lines 4981 5314 +333
Branches 939 980 +41
=======================================
+ Hits 4287 4618 +331
+ Misses 547 544 -3
- Partials 147 152 +5
Continue to review full report at Codecov.
|
Benchmark is done. Checkout the benchmark result page. Benchmark diff v0.5.1 vs. mainParametrized benchmark signatures: BenchmarkOptimize.time_optimize(index_dependent, grouped, weight)
Benchmark diff main vs. PRParametrized benchmark signatures: BenchmarkOptimize.time_optimize(index_dependent, grouped, weight)
|
2ec7757
to
4589886
Compare
a95c120
to
c6576b9
Compare
SonarCloud Quality Gate failed.
|
3e9f55b
to
0757349
Compare
After rebasing, please sit together @s-weigand and @joernweissenborn and try to turn one or two of the examples into a project. e.g. this one |
0757349
to
6a038f5
Compare
See https://peps.python.org/pep-3134/ (Thnx sourcery :D)
…tors 🧪 Added additional tests for generators
c08644d
to
2eef676
Compare
Took a while but I fixed all issues I still had with this PR (we will leave the test poisoning for a different PR). @jsnel for a quick usability test in binder Save the dataset from the testing data to the file which gets imported from glotaran.io import save_dataset
from glotaran.testing.simulated_data.sequential_spectral_decay import (
DATASET as dummy_data,
)
save_dataset(dummy_data, "testdata.nc", allow_overwrite=True) Create project skeleton from glotaran.project import Project
EXAMPLE_DIR = "my_project"
EXAMPLE_DATA = "testdata.nc"
gtap = Project.open(EXAMPLE_DIR) # open a project
gtap.import_data(EXAMPLE_DATA, name="dataset_1", ignore_existing=True)
gtap.generate_model(
model_name="simple_model",
generator_name="decay_sequential",
generator_arguments={"nr_compartments": 3, "irf": True},
ignore_existing=True,
)
gtap.generate_parameters("simple_model", parameters_name="simple_params", ignore_existing=True) Edit the parameters
Optimize the model # Note: For now, you need to open the generated models in an editor and change the starting values.
gtap.optimize(
model_name="simple_model",
parameters_name="simple_params",
maximum_number_function_evaluations=1,
result_name="simple_result",
) # optimize the model parameters
result = gtap.load_result("simple_result") # load the result
result_path = gtap.get_result_path("simple_result") # convenience for e.g. plotting @joernweissenborn I also fixed some naming consistency issues please also check my changes. |
lgtm, if the tests are working again |
Kudos, SonarCloud Quality Gate passed!
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be fine to merge now
This PR adds a basic
Project
class.The
Project
class is intended to serve as a standard API topyglotaran
.Add the moment, using
pyglotaran
as a python package requires alot of imports from different sub packages. This ok because our current API is kind of a "super user" API. The nature of it is that it changes alot, which is not user friendly. On the other hand side, we now have a deprecation framework, which is very useful but slows down development.The
Project
class mitigates this. It is designed as a user API, escpeicially with having GUIs and stuff in mind. It is meant to be a representation of the actual iterative process of global target analysis.Details
The
Project
class as implemented in this PR is basically a kind of "API aggregator" plus a KISS principle based "database" calledProjectRegistry
.It is essentially a collection of a project file plus
This folders are represented by
ProjectRegistry
objects. They work by leveraging the io plugin system andpathlib
.A worwflow in looks like this:
Checklist
Closes issues
closes #XXXX