-
Notifications
You must be signed in to change notification settings - Fork 4
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
BaseCalculator #47
BaseCalculator #47
Conversation
More comprehensive tests are added in PR #47
More comprehensive tests are added in PR #47
4cb9068
to
9e0dc34
Compare
9e0dc34
to
36d8ede
Compare
Add installation and testing instructions.
* Renamed 'pointer' to 'reference' (there are no pointers in python) * Removed commented code
Remove unused modules Remove travis check pep8 fixes
Removed logging since not used.
Adding class docstring to class.
Typo in authors list Remove implementation of init_parameters(), it's an abstract class, so raise NotImplementedError. TODO: test init_parameters()
Make summary more concise.
black reformatting.
Adjust to new API (libpyvinyl) TODO: fix BaseCalculator, see error in cell 7)
|
This error message: libpyvinyl/libpyvinyl/BaseCalculator.py Lines 133 to 138 in 2a226f5
By the way, do we still need to care about that jupyter notebook? Can we just take the |
bdf7df0
to
4ed5ea1
Compare
* Fixing html footer. * Adding more py versions to be supported. * Update gitignore egg files are now ignored. * Added new ci file for github actions. * Removed obsolet travis ci file. * Fixing html footer. * Adding more py versions to be supported. * Update gitignore egg files are now ignored. * Added new ci file for github actions. * Removed obsolet travis ci file. * Carsten (#30) * Fixing version issue in CI setup. * Update ci file. libpyvinyl was not installed into testing environment, this caused ImportError. * Update gitignor Ignore emacs swap files. * Small cosmetic fixes. Co-authored-by: Carsten Fortmann-Grote <[email protected]> * Add readthedocs.yaml Configuration of basic rtd settings now live in this file as recommended by readthedocs. * Update readthedocs.yaml Fixed ubuntu version * Update readthedocs.yaml Fixing path to rtd python conf file. * Update readthedocs.yaml Add global requirements and project to install step * Update readthedocs.yaml Trying to fix package install. * Remove readthecods.yaml from git. * Update refman.rst Replace autoclass by automodule statements. Include Collection and Instrument modules. * Update authors. * Update gitignore. json dumps, h5 and tmp files produced by examples and tests are now ignored. * Updated parameters container to Ordered_dict to preserve parameter order. Moved value from an attribute to a property. In connection to this, I made the consequence of entering an illegal value an error instead of it just being ignored. This was chosen as the setter function is now hidden from the user, so they wouldnt necessarily know a check is being made behind the scences. Updated tests to account for removal of set_value function. * using json_tricks in order to support dump and load of numpy arrays in json * instructions to run tests: suggested pytest package for developers * more tests for the Parameter class * - changed logic of interval - modified tests to accomodate new logic for intervals - add_interval and add_option now have an additional argument * small fix to ParameterTest * Suggested changes by Junchen: setup.py taking requirements from requirements.txt file * Replace interval and option with _interval and _option * Using closed intervals on both sides * Fixing logic of is_legal to simplify the reading of the code * Fixing and adding more tests for checking validity of values * More meaningful error message when looking for a parameter that does not exist * Addressing Carsten comments * Added __iter__ and __next__ methods to CalculatorParameters which use the underlying parameters.values() __iter__ and __next__ methods. If we have a CalculatorParameters object called A, these two are eqvivalent: for parameter in A.parameters.values(): print(parameter) for parameter in A: print(parameter) It is also possible to get all the parameter objects contained in a CalculatorParameters object into a list with just: parameter_list = list(A) * set_parameters method in base calculator * Updated test to check set_parameters. * removed specialized calculator and removed useless numpy dependency from BaseCalculator * Specializedcalculator moved into the Tests * forgotten SpecializedCalculator in tests/ * Split requirements in prod.txt and dev.txt * github workflow using black also added to the dev requirements * Update ci.yml * Fix CI * reformatted by black * Several changes: - Introduced type checks for values, intervals and options. - Using pint.Quantity for floats and physical quantities with units - Encode and decode pint.Quantity in json * Adding test for using units. * Removed print * Code cleaning and improvements plus more tests * respecting flake8 suggestion as reported by Junchen * fixing typos * Add BaseData.py * add DiffractionData examples * merge * Update ci file. libpyvinyl was not installed into testing environment, this caused ImportError. * Update data and format base classes and example. In this way, we can avoid dynamic module loading. * Adding specs * Update api_spec.py Tried to combine Jun's and my earlier prototype into one. Not entirely happy yet, need to add parameters / collections to get the whole story. * add pseudocode * add pseudocode * modified based on the first interation of reviews. * update BaseData and BaseFormat examples * Add module docstring. * comply snake case naming style * cleaned up the pseudo code for discussion * nice examples * add BaseDataTest.py * clean up unnecessary test and add integration test * NumberCalculatorsFinished * update PlusCalculator * Add test_ArrayCalculators.py * add test_Instrument.py * Update BaseCalculator in plusminus * the new proposed BaseCalculator * No need input_keys for calculator init * Format: Predicble return object from write * add initialization check * minor: error raise info updated * fix errors for test_ArrayCalculators * Black format * improve BaseDataTest * add list format test * make mapping_type() consistent * fix else in __get_dict_data and __get_file_data * Add docstrings to BaseData * add DataCollection to_list test * Update plusminus test * Update BaseFormat convert example * Update BaseFormat convert example * Temporary RandomImageCalculator.py for CI fixing * implement Optional hint * update BaseFormat placeholder functions and correct typos * Fix typos and tests for duplicating file output * Update format return style * Remove unnecessary tests More comprehensive tests are added in PR #47 * Format correction * Update ci.yml to include testing pytest scripts * update docstrings of basecalculator * clean up BaseCalculator * finish BaseCalcualtor, working on Test * fix base_dir * cleaned up BaseCalculatorTest * set DataCollection setitem * fixed all tests * add pytest for integration * uncomment missed calculator test * remove SpecializedCalculator.py * add edit parameter tests in BaseCalculatorTest.py * fix ci * add | to ci.yml * Parameters.to_dict(): Deepcopy to not modify the original parameters * Update README Add installation and testing instructions. * Update BaseCalculatorTest * Renamed 'pointer' to 'reference' (there are no pointers in python) * Removed commented code * Update Test. Remove unused modules Remove travis check pep8 fixes * Syntax fix * Update BaseCalculatorTest Removed logging since not used. * Update BaseCalculatorTest Adding class docstring to class. * Update BaseCalculator Typo in authors list Remove implementation of init_parameters(), it's an abstract class, so raise NotImplementedError. TODO: test init_parameters() * Update README Make summary more concise. * Update BaseCalculator black reformatting. * Update example notebook Adjust to new API (libpyvinyl) TODO: fix BaseCalculator, see error in cell 7) * Add Parameter class to module. * Seperate unit tests and integration tests * update tests in README.md * update ci.yml with the new test file structure * Fix BaseCalculator output consistensy check * check expected_data can be reached, then allow extra data to be read * expose BaseData in libpyvinyl __init__ * update setup.py toward 0.1.0 * bump version in setup.py * Update CI badge in README.md Replace the outdated Travis badge with current github CI badge. * Add Parameters test corresponding to #51 * Method to retrieve the parameter value as a pint Quantity * Support for numpy floats as input with conversion to pint.Quantity * numpy now required by Parameter class in order to accept numpy floats as value * Allow BaseCalculator to accept None input. * Fix #50 by increasing ljust and adding a space To deal with very long parameter names, we increasted the ljust and added a space after the name, value and unit. * Remove example calculators, which are not compatible with the new BaseCalculator class * Remove unnecessary docs of the integration test - Remove the license, history.rst and contributing - Add graphs explaining the plusminus integration test * Fix setup.py author format Co-authored-by: Carsten Fortmann-Grote <[email protected]> Co-authored-by: Carsten Fortmann-Grote <[email protected]> Co-authored-by: Shervin Nourbakhsh <[email protected]> Co-authored-by: Carsten Fortmann-Grote <[email protected]> Co-authored-by: Mads Bertelsen <[email protected]> Co-authored-by: mads-bertelsen <[email protected]> Co-authored-by: shervin86 <[email protected]>
More comprehensive tests are added in PR #47
More comprehensive tests are added in PR PaNOSC-ViNYL#47
Updated the
BaseCalculator
:BaseCalculator.py
based on the "plusminus" exampleDEVEL.md
and.github/workflows/ci.yml
to testtest_BaseData.py
andintegration
by default.The main changes are in
BaseCalculator.py
and its testbasecalculatortest.py