diff --git a/src/somef/export/json_export.py b/src/somef/export/json_export.py index 7f9d48c5..80c37cf7 100644 --- a/src/somef/export/json_export.py +++ b/src/somef/export/json_export.py @@ -974,6 +974,14 @@ def unify_results(repo_data: dict) -> dict: else: canonical = canonicalize_value(value, value_type) key = str(canonical) + elif category == constants.CAT_REQUIREMENTS: + req_name = result.get("name", "").strip().lower() + req_version = result.get("version", "").strip() + if req_name: + key = f"REQ-{req_name}-{req_version}" + else: + canonical = canonicalize_value(value, value_type) + key = str(canonical) else: # Normal behavior for the rest of the categories canonical = canonicalize_value(value, value_type) diff --git a/src/somef/header_analysis.py b/src/somef/header_analysis.py index c3046d61..a7489a9c 100644 --- a/src/somef/header_analysis.py +++ b/src/somef/header_analysis.py @@ -138,13 +138,25 @@ def extract_header_content(text: str) -> Tuple[pd.DataFrame, str | None]: content, none_header_content = mardown_parser.extract_content_per_header(text, headers) parents = mardown_parser.extract_headers_parents(text) + + # parent_list = [parents.get(h) for h in header_list] + + content_map = dict(zip(header_list, content)) + aligned_content = [content_map[h] for h in header_list] + aligned_parents = [parents.get(h) for h in header_list] + + # df = pd.DataFrame({ + # 'Header': header_list, + # 'Content': content, + # 'ParentHeader': [parents.get(h) for h in header_list], + # }) + df = pd.DataFrame({ 'Header': header_list, - 'Content': content, - 'ParentHeader': [parents.get(h) for h in header_list], + 'Content': aligned_content, + 'ParentHeader': aligned_parents, }) - # df['Content'].replace('', np.nan, inplace=True) df['Content'] = df['Content'].replace('', np.nan) df = df.dropna(subset=['Content']) diff --git a/src/somef/parser/mardown_parser.py b/src/somef/parser/mardown_parser.py index d1139e24..f54c6593 100644 --- a/src/somef/parser/mardown_parser.py +++ b/src/somef/parser/mardown_parser.py @@ -19,9 +19,13 @@ def extract_headers(original_text): if is_header(line): #text = re.sub(regex, '', line) text = get_tag_content(line) + # Check if the header is actually a separator as ----------- + if is_separator_header(text): + index += 1 + continue if index + 1 >= limit: output[text] = True - elif not splitted[index + 1].startswith(" elements by the Markdown parser.""" + return re.match(r'^[-=]+$', text.strip()) is not None + +def remove_separator_lines(text: str) -> str: + """Removes separator lines (--- or ===) from extracted content.""" + lines = text.split('\n') + return '\n'.join(line for line in lines if not is_separator_header(line)) def extract_content_per_header(original_text, headers): keys = list(headers.keys()) @@ -86,7 +103,9 @@ def extract_content_per_header(original_text, headers): header_content = get_text(top_index + offset, -1, text_tokenized) if header_content.startswith('\n'): header_content = header_content[1:] - content.append(header_content) + if headers[top]: + content.append(header_content) + # content.append(header_content) output[top] = header_content return content, none_header_content @@ -120,7 +139,7 @@ def get_text(init_index, end_index, text_tokenized): while init_index < end_index: output = output + '\n' + text_tokenized[init_index] init_index += 1 - return output + return remove_separator_lines(output) def extract_bash(text): diff --git a/src/somef/test/test_JSON_export.py b/src/somef/test/test_JSON_export.py index 57349a53..619061bc 100644 --- a/src/somef/test/test_JSON_export.py +++ b/src/somef/test/test_JSON_export.py @@ -874,5 +874,133 @@ def test_issue_953_publication_reconciliation(self): assert bibtex_cit is not None, "Bibtex citation (Text_excerpt) not found" assert bibtex_cit["result"]["format"] == "bibtex" assert bibtex_cit["result"]["year"] == "2019" + + os.remove(output_path) + + + def test_issue_reconciliation_workloop(self): + """Checks that key metadata is correctly extracted and reconciled from codemeta.json and README. + Issue with canolicalization ofvalues""" + + output_path = test_data_path + "test_issue_reconciliation_workloopr.json" + + somef_cli.run_cli(threshold=0.8, + ignore_classifiers=False, + repo_url=None, + local_repo=test_data_repositories + "workloopr", + doc_src=None, + in_file=None, + output=output_path, + graph_out=None, + graph_format="turtle", + codemeta_out=None, + pretty=True, + missing=False, + readme_only=False) + + with open(output_path, "r") as text_file: + json_content = json.loads(text_file.read()) + + assert constants.CAT_AUTHORS in json_content + authors = json_content[constants.CAT_AUTHORS] + assert len(authors) == 2 + author_names = [a["result"]["value"] for a in authors] + assert "Vikram B. Baliga" in author_names + assert "Shreeram Senthivasan" in author_names + + assert constants.CAT_INSTALLATION in json_content + installation = json_content[constants.CAT_INSTALLATION] + assert any("devtools::install_github" in i["result"]["value"] for i in installation) + + assert constants.CAT_CITATION in json_content + citations = json_content[constants.CAT_CITATION] + # print(citations) + assert any("workloopR" in c["result"]["value"] for c in citations) + + os.remove(output_path) + + + + def test_issue_reconciliation_cropwater(self): + """Checks that key metadata is correctly extracted and reconciled from codemeta.json and README. + Issue with canolicalization ofvalues""" + + output_path = test_data_path + "test_issue_reconciliation_cropwater.json" + + somef_cli.run_cli(threshold=0.8, + ignore_classifiers=False, + repo_url=None, + local_repo=test_data_repositories + "cropwater", + doc_src=None, + in_file=None, + output=output_path, + graph_out=None, + graph_format="turtle", + codemeta_out=None, + pretty=True, + missing=False, + readme_only=False) + + with open(output_path, "r") as text_file: + json_content = json.loads(text_file.read()) + assert constants.CAT_AUTHORS in json_content + authors = json_content[constants.CAT_AUTHORS] + assert len(authors) == 5 + author_names = [a["result"]["value"] for a in authors] + assert "Gabriel Constantino Blain" in author_names + assert "Adam H. Sparks" in author_names + + + assert constants.CAT_INSTALLATION in json_content + installation = json_content[constants.CAT_INSTALLATION] + assert any("gabrielblain/CropWaterBalance" in i["result"]["value"] for i in installation) + + assert constants.CAT_LICENSE in json_content + licenses = json_content[constants.CAT_LICENSE] + spdx = next((l for l in licenses if l["result"].get("spdx_id") == "MIT"), None) + assert spdx is not None, "MIT license not found" + + assert constants.CAT_DESCRIPTION in json_content + os.remove(output_path) + + + def test_issue_980_reconciliation_requirements(self): + """Checks that requirements with the same name and version are correctly reconciled + into a single entry merging sources, even when their raw values are not the same + (ej. 'pracma (>= 2.0.7)' vs 'pracma==>= 2.0.7').""" + + output_path = test_data_path + "test_issue_980_reconciliation_requirements.json" + + somef_cli.run_cli(threshold=0.8, + ignore_classifiers=False, + repo_url=None, + local_repo=test_data_repositories + "ggstatsplot", + doc_src=None, + in_file=None, + output=output_path, + graph_out=None, + graph_format="turtle", + codemeta_out=None, + pretty=True, + missing=False, + readme_only=False) + + with open(output_path, "r") as text_file: + json_content = json.loads(text_file.read()) + + requirements = json_content[constants.CAT_REQUIREMENTS] + # print(requirements) + + seen_keys = [(r["result"]["name"], r["result"].get("version", "")) for r in requirements] + unique_keys = set(seen_keys) + + assert len(seen_keys) == len(unique_keys), ( + f"Duplicate requirements found: " + f"{[k for k in unique_keys if seen_keys.count(k) > 1]}" + ) + + os.remove(output_path) + + diff --git a/src/somef/test/test_data/README-laueNN.md b/src/somef/test/test_data/README-laueNN.md new file mode 100644 index 00000000..862b4f40 --- /dev/null +++ b/src/somef/test/test_data/README-laueNN.md @@ -0,0 +1,123 @@ + +![til](https://github.com/BM32ESRF/LaueNN/blob/main/docs/idea_lauenn/frames_medres.gif) + +[![Conda](https://img.shields.io/conda/pn/bm32esrf/lauetoolsnn?color=green&label=supported%20platform)](https://anaconda.org/bm32esrf/lauetoolsnn) +[![GitHub tag (latest by date)](https://img.shields.io/github/v/tag/BM32ESRF/LaueNN?color=blue&label=Github%20tag)](https://github.com/BM32ESRF/LaueNN) + +[![Lint, test, build, and publish](https://github.com/BM32ESRF/LaueNN/actions/workflows/complete_workflow.yml/badge.svg)](https://github.com/BM32ESRF/LaueNN/actions/workflows/complete_workflow.yml) +[![PyPI](https://img.shields.io/pypi/v/lauetoolsnn)](https://pypi.python.org/pypi/lauetoolsnn/) +[![PyPI pyversions](https://img.shields.io/pypi/pyversions/lauetoolsnn.svg)](https://pypi.python.org/pypi/lauetoolsnn/) + +[![Anaconda-Server Badge](https://anaconda.org/bm32esrf/lauetoolsnn/badges/license.svg)](https://anaconda.org/bm32esrf/lauetoolsnn) +[![Conda](https://img.shields.io/conda/v/bm32esrf/lauetoolsnn?style=flat-square)](https://anaconda.org/bm32esrf/lauetoolsnn) + + +[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/BM32ESRF/LaueNN/issues) + + +# lauetoolsnn/LaueNN +An autonomous feed-forward neural network (FFNN) model to predict the HKL in single/multi-grain/multi-phase Laue patterns with high efficiency and accuracy is introduced. + +Laue diffraction indexation (especially Laue images comprising of diffraction signal from several polycrystals/multi phase materials) can be a very tedious and CPU intensive process. To takle this, LaueNN or LauetoolsNN was developed employing the power of neural network to speed up a part of the indexation process. In the LaueNN_presentation (https://github.com/BM32ESRF/LaueNN/tree/main/presentations/LaueNN_presentation.pdf), several steps of Laue pattern indexation with classical approach is described. We have replaced the most CPU intensive step with the Neural Networks. The step where the Laue indices hkl of each spot os now determined with the Neural networks, alongside the spot hkl index, the neural network also predicts the Material that spot belongs to. This can be useful incase of Laue images comprising of diffraction signal from multi-phases. +LaueNN uses the existing modules of Lauetools to generate simulated Laue patterns. The whole workflow and the application of this tool is illustrated in this article (https://onlinelibrary.wiley.com/iucr/doi/10.1107/S1600576722004198) + +For classical indexation of Laue pattern (GUI and scripts), check out the sister package: https://github.com/BM32ESRF/lauetools + + +### Video tutorial +------------------------------ +- Video 1: Working with jupyter notebook scripts : https://cloud.esrf.fr/s/6q4DJfAn7K46BGN +- Video 2: Working with lauetoolsnn GUI : https://cloud.esrf.fr/s/AeGow4CoqZRJiyx + + +### Requirements: (latest version of each libraries accessed on 03/04/2022) +------------------------------ +- PyQt5 (GUI) +- matplotlib +- Keras +- tensorflow +- numpy +- scipy (scipy transform rotation is used) +- h5py (required for writing neural network model files) +- scikit-learn (required for generating trained model classification reports) +- fabio (used for opening raw Laue tiff images) +- networkx (to be replaced with numpy in the future) +- scikit-image (used for hough based analysis of Laue patterns) +- tqdm (required only for notebook scripts) +- opencv (for LOG based peak search) +- pandas and pytables (for writing pickle to h5) + + +### Installation +------------------------------ +Lauetoolsnn can be installed either via PYPI usiing the following command in terminal (this installs all dependencies automatically): + +https://pypi.org/project/lauetoolsnn/ + +https://anaconda.org/bm32esrf/lauetoolsnn + +``` bash +$ pip install lauetoolsnn +$ or +$conda install -c bm32esrf lauetoolsnn -c conda-forge +``` +For macOS user, please use the conda installation to avoid build errors or can be compiled and installed locally via the setup.py file. Download the Github repository and type the following in terminal. In this case, the dependencies has to be installed manually. The latest version of each dependency works as of (01/04/2022). +``` bash +$ python setup.py install +``` + +See procedure_usage_lauetoolsnn.pdf for installation and how to write the configuration file to be used with GUI. +This project is also hosted on sourceforge.net https://lauetoolsnn.sourceforge.io + + +### Documentation +------------------------------ +Documentation (under construction) for lauetoolsnn/lauenn is on the following webpage +https://lauenn.readthedocs.io/en/latest/ + + +### Example case +------------------------------ +Two example case studies are included in the lauetoolsnn\examples folder. +Run the GUI by either launching directly from the terminal using the 'lauetoolsnn' command or by running it locally with python lauetoolsneuralnetwork.py command. + +First step is to load the config.txt from the example folder, it sets all the values of the GUI to the case study. +In the GUI: +- Step1: File --> load config . Select the config file from the example directory. +- Step1a: If config file is not available, one can set parameters in the configure parameters window directly. +- Step2: Press the configure parameters button and press Accept button at the end (the values are loaded from the config file). +- Step3: Press Generate Training dataset button. This will generate the training and validation dataset for neural network. +- Step4: Press Train Neural network button. This will start the training process and once finished will save the trained model. +- Step5: Press the Live prediction with IPF map to start the prediction on predefined experimental dataset. Example datafile is included in the examples folder. +- Step6: Once analyzed, the results can be saved using the save results button. + +In addition, all the above mentioned steps can be done without the GUI and are detailed in the lauetoolsnn\example_notebook_scripts folder. +Jupyter notebook scripts are provided to run all the steps sequentially. + +The indexed orientation matrix is also written in ".ctf" format, which can then be opened with channel 5 Aztec or MTEX software to do post processing related to orientations analysis. MTEX post processing script is also included in the lauetoolsnn\util_script\MTEX_plot.m + + +### Citation +------------------------------ +If you use this software, please cite it using the metadata available in the citation_bibtex.cff file in root. +``` bash +Purushottam Raj Purohit, R. R. P., Tardif, S., Castelnau, O., Eymery, J., Guinebretiere, R., Robach, O., Ors, T. & Micha, J.-S. (2022). J. Appl. Cryst. 55, 737-750. +``` + + +### Known Issues +------------------------------ +So far, there is a issue with H5py and HDF5 version in the windows installation with conda. If error with H5py version mismatch exist after conda installation, please try "pip install lauetoolsnn" on windows as this should not have this problem. The other possibility is to install the H5py with pip before or after installing lauetoolsnn with conda. + + +### Support +------------------------------ +Do not hesitate to contact the development team at [purushot@esrf.fr](mailto:purushot@esrf.fr) or [micha@esrf.fr](mailto:micha@esrf.fr). + +### Funding +------------------------------ +This code was developed as a result of French-German project funded respectively by the ANR and DFG (HoTMiX project reference number ANR-19-CE09-0035-01): https://www.bam.de/Content/EN/Projects/HoTMiX/hotmix.html + +### Maintainer(s) +------------------------------ +* [Ravi PURUSHOTTAM](https://github.com/ravipurohit1991) diff --git a/src/somef/test/test_data/repositories/cropwater/DESCRIPTION b/src/somef/test/test_data/repositories/cropwater/DESCRIPTION new file mode 100644 index 00000000..f4fd5619 --- /dev/null +++ b/src/somef/test/test_data/repositories/cropwater/DESCRIPTION @@ -0,0 +1,61 @@ +Package: CropWaterBalance +Title: Climate Water Balance for Irrigation Purposes +Version: 0.2.0.9000 +Authors@R: c( + person( + given = "Gabriel Constantino", + family = "Blain", + role = c("aut", "cre"), + email = "gabriel.blain@sp.gov.br", + comment = c(ORCID = "0000-0001-8832-7734")), + person( + given = "Graciela R.", + family = "Sobierajski", + role = "aut", + comment = c(ORCID = "0000-0002-7211-9268")), + person( + given = "Regina C.", + family = "Matos Pires", + role = "aut", + comment = c(ORCID = "0000-0003-4200-7094")), + person( + given = "Adam H.", + family = "Sparks", + email = "adamhsparks@gmail.com", + role = "aut", + comment = c(ORCID = "0000-0002-0061-8359")), + person( + given = "Leticia L.", + family = "Martins", + role = "aut", + comment = c(ORCID = "0000-0002-0299-3005")) + ) +Description: Calculates daily climate water balance for irrigation purposes and + also calculates the reference evapotranspiration (ET) using three methods, + Penman and Monteith (Allen et al. 1998, ISBN:92-5-104219-5); + Priestley and Taylor (1972) ; or Hargreaves and Samani (1985) + . Users may specify a management allowed depletion + (MAD), which is used to suggest when to irrigate. The functionality allows + for the use of crop and water stress coefficients as well. +License: MIT + file LICENSE +Encoding: UTF-8 +Roxygen: list(markdown = TRUE) +RoxygenNote: 7.3.2 +Depends: + R (>= 3.10) +LazyData: true +Suggests: + knitr, + rmarkdown, + spelling, + testthat (>= 3.0.0) +Config/testthat/edition: 3 +Config/testthat/parallel: true +Imports: + PowerSDI, + lubridate, + stats +URL: https://github.com/gabrielblain/CropWaterBalance, https://gabrielblain.github.io/CropWaterBalance/ +BugReports: https://github.com/gabrielblain/CropWaterBalance/issues +VignetteBuilder: knitr +Language: en-US \ No newline at end of file diff --git a/src/somef/test/test_data/repositories/cropwater/LICENSE.md b/src/somef/test/test_data/repositories/cropwater/LICENSE.md new file mode 100644 index 00000000..43cf1339 --- /dev/null +++ b/src/somef/test/test_data/repositories/cropwater/LICENSE.md @@ -0,0 +1,21 @@ +# MIT License + +Copyright (c) 2024 CropWaterBalance authors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/src/somef/test/test_data/repositories/cropwater/README.md b/src/somef/test/test_data/repositories/cropwater/README.md new file mode 100644 index 00000000..42d145c9 --- /dev/null +++ b/src/somef/test/test_data/repositories/cropwater/README.md @@ -0,0 +1,649 @@ +--- +editor_options: + markdown: + wrap: sentence +output: github_document +--- + + + +[![R-CMD-check](https://github.com/gabrielblain/CropWaterBalance/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/gabrielblain/CropWaterBalance/actions/workflows/R-CMD-check.yaml) +[![R-CMD-check](https://github.com/adamhsparks/CropWaterBalance/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/adamhsparks/CropWaterBalance/actions/workflows/R-CMD-check.yaml) + + +# CropWaterBalance + +Crop water balance accounting in the root zone for irrigation purposes. + +# Basic Description + +{CropWaterBalance} is an R package designed to assist users in irrigation scheduling based on the Water Balance Approach. +The package is capable of calculating reference evapotranspiration (ET0) through various methods and conducting crop water balance accounting. +Additionally, {CropWaterBalance} includes auxiliary functions for comparing different ET0 estimation methods, calculating descriptive statistics for ET0 and rainfall series, and estimating soil heat flux and water stress coefficient. +The functions `ET0_HS()`, `ET0_PT()`, and `ET0_PM()` are used to estimate daily ET0 amounts using the methods of Hargreaves-Samani, Priestley-Taylor, and FAO-56 Penman-Monteith, respectively. +The `Descriptive()` function is specifically designed to calculate descriptive statistics for ET0 and rainfall series, including sample mean, median, standard deviation, standard error, maximum value, minimum value, and frequency of zeros. +Additionally, the `Compare()` function may be used to calculate measures of accuracy and agreement between two ET0 or rainfall series. +The `Soil_Heat_Flux()` function uses average air temperature data to estimate the soil heat flux, and the `Water_Stress_Coef()` function calculates the water stress coefficient for a crop. +The package depends on R (\>= 2.10) and imports functions from the R packages {[PowerSDI](https://CRAN.R-project.org/package=PowerSDI/)} and {[lubridate](https://CRAN.R-project.org/package=lubridate)}. + +# Installation + +``` r +devtools::install_github("gabrielblain/CropWaterBalance") +``` + +# Basic Instructions + + + +## Function ET0_PM() + +Calculates daily reference evapotranspiration amounts using the Penman and Monteith method. + +## Usage + + +``` r +ET0_PM(Tavg, + Tmax, + Tmin, + Rn, + RH, + WS, + G = NULL, + Alt +) +``` + +## Arguments + +- Tavg: A vector, 1-column matrix or data frame with daily average air temperature. +- Tmax: A vector, 1-column matrix or data frame with daily maximum air temperature in Celsius degrees. +- Tmin: A vector, 1-column matrix or data frame with daily minimum air temperature in Celsius degrees. +- Rn: A vector, 1-column matrix or data frame with daily net radiation in MJ M-2 DAY-1. +- RH: A vector, 1-column matrix or data frame with daily relative Humidity in %. +- WS: A vector, 1-column matrix or data frame with daily wind speed in M S-1. +- G: Optional. A vector, 1-column matrix or data frame with daily soil heat flux in MJ M-2 DAY-1. Default is `NULL` and if `NULL` it is assumed to be zero. May be provided by Soil_Heat_Flux. +- Alt: A single number defining the altitude at crop's location in metres. + +## Value + +Daily reference evapotranspiration amounts in millimetres. + +## Examples + + +``` r +Tavg <- DataForCWB[, 2] +Tmax <- DataForCWB[, 3] +Tmin <- DataForCWB[, 4] +Rn <- DataForCWB[, 6] +WS <- DataForCWB[, 7] +RH <- DataForCWB[, 8] +G <- DataForCWB[, 9] +head(ET0_PM(Tavg, Tmax, Tmin, Rn, RH, WS, G, Alt = 700)) +``` + +``` +## ET0_PM +## [1,] 2.440372 +## [2,] 4.171917 +## [3,] 4.290477 +## [4,] 3.665459 +## [5,] 4.848520 +## [6,] 5.669878 +``` + +## Function ET0_PT() + +Calculates daily reference evapotranspiration amounts using the Priestley-Taylor method. + +## Usage + + +``` r +ET0_PT(Tavg, + Rn, + G = NULL, + Coeff = 1.26 +) +``` + +## Arguments + +- Tavg: A vector, 1-column matrix or data frame with daily average air temperature. +- Rn: A vector, 1-column matrix or data frame with daily net radiation in MJ M-2 DAY-1. +- G: Optional. A vector, 1-column matrix or data frame with daily soil heat flux in MJ M-2 DAY-1. Default is `NULL` and if `NULL` it is assumed to be zero. May be provided by Soil_Heat_Flux +- Coeff: Single number defining the Priestley-Taylor coefficient. Default is 1.26 + +## Value + +Daily reference evapotranspiration amounts in millimetres. + +## Examples + + +``` r +Tavg <- DataForCWB[, 2] +Rn <- DataForCWB[, 6] +G <- DataForCWB[, 9] +head(ET0_PT(Tavg, Rn, G)) +``` + +``` +## ET0_PT +## [1,] 3.432709 +## [2,] 5.849554 +## [3,] 6.432616 +## [4,] 5.695334 +## [5,] 7.023900 +## [6,] 7.817355 +``` + +## Function ET0_HS() + +Calculates daily reference evapotranspiration amounts using the Hargreaves-Samani method. + +## Usage + + +``` r +ET0_HS( + Ra, + Tavg, + Tmax, + Tmin +) +``` + +## Arguments + +- Ra: A vector, 1-column matrix or data frame with daily net radiation in MJ M-2 DAY-1. +- Tavg: A vector, 1-column matrix or data frame with daily average air temperature. +- Tmax: A vector, 1-column matrix or data frame with daily maximum air temperature in Celsius degrees. +- Tmin: A vector, 1-column matrix or data frame with daily minimum air temperature in Celsius degrees. + +## Value + +Daily reference evapotranspiration amounts in millimetres. + +## Examples + + +``` r +Tavg <- DataForCWB[, 2] +Tmax <- DataForCWB[, 3] +Tmin <- DataForCWB[, 4] +Ra <- DataForCWB[, 5] +head(ET0_HS( + Ra = Ra, + Tavg = Tavg, + Tmax = Tmax, + Tmin = Tmin +)) +``` + +``` +## ET0 +## [1,] 4.703700 +## [2,] 5.331592 +## [3,] 5.664174 +## [4,] 6.163377 +## [5,] 5.291303 +## [6,] 6.251883 +``` + +## Function Soil_Heat_Flux() + +Calculates the daily amounts of Soil Heat Flux. + +## Usage + + +``` r +Soil_Heat_Flux(Tavg) +``` + +## Arguments + +- Tavg: A vector, 1-column matrix or data frame with daily average air temperature. + +## Value + +Daily amounts of soil Heat flux in MJ m-2 day-1. + +## Examples + + +``` r +Tavg <- DataForCWB[, 2] +head(Soil_Heat_Flux(Tavg)) +``` + +``` +## Warning in Soil_Heat_Flux(Tavg): The first 3 G values were set to zero +``` + +``` +## [,1] +## [1,] 0.0000000 +## [2,] 0.0000000 +## [3,] 0.0000000 +## [4,] 0.3806333 +## [5,] -0.7796333 +## [6,] -0.2007667 +``` + +## Function Descriptive() + +Calculates descriptive statistics for rainfall, evapotranspiration, or other variable. + +## Usage + + +``` r +Descriptive(Sample) +``` + +## Arguments + +- Sample: A vector, 1-column matrix or data frame with rainfall, evapotranspiration, or other variable. + ## Value + +- sample mean (Avg), sample median (Med), sample standard variation (SD), sample standard Error (SE), maximum value (MaxValue), minimum value (MinValue), and frequency of zeros (FreqZero%) \## Examples + +## Examples + + +``` r +Rain <- DataForCWB[, 10] +Descriptive(Sample = Rain) +``` + +``` +## SampleSize Avg Med SD SE MaxValue MinValue FreqZero% +## 1 129 6.53 0.25 13.06 1.15 71.37 0 48.06 +``` + +## Function Compare() + +Calculates measures of accuracy and agreement. + +## Usage + + +``` r +Compare(Sample1, Sample2) +``` + +## Arguments + +- Sample1: A vector, 1-column matrix or data frame with evapotranspiration or other variable. +- Sample2: A vector, 1-column matrix or data frame with evapotranspiration or other variable. + +## Value + +- Absolute mean error (AME), Square root of the mean squared error (RMSE), Willmott's indices of agreement: original (dorig), Modified (dmod) and refined (dref), Pearson determination coefficient (R2). + +## Examples + + +``` r +Tavg <- DataForCWB[, 2] +Tmax <- DataForCWB[, 3] +Tmin <- DataForCWB[, 4] +Rn <- DataForCWB[, 6] +WS <- DataForCWB[, 7] +RH <- DataForCWB[, 8] +G <- DataForCWB[, 9] +Sample1 <- + ET0_PM( + Tavg = Tavg, + Tmax = Tmax, + Tmin = Tmin, + Rn = Rn, + RH = RH, + WS = WS, + G = G, + Alt = 700 + ) +Sample2 <- ET0_PT(Tavg = Tavg, Rn = Rn, G = G) +Compare(Sample1 = Sample1, Sample2 = Sample2) +``` + +``` +## AME RMSE dorig dmod dref RQuad +## 1 1.69222 1.813449 0.6403158 0.376103 -0.05737454 0.8675223 +``` + +## Function CWB() + +Calculates several parameters of the crop water balance. +It also suggests when and how much to irrigate. + +## Usage + + +``` r +CWB( + Rain, + ET0, + AWC, + Drz, + Kc = NULL, + Irrig = NULL, + MAD = NULL, + InitialD = 0, + start.date +) +``` + +## Arguments + +- Rain: Vector, 1-column matrix or data frame with daily rainfall totals in millimetres. + +- ET0: Vector, 1-column matrix or data frame with daily reference evapotranspiration in millimetres. + +- AWC: Vector, 1-column matrix or data frame with the available water capacity of the soil, that is: the amount of water between field capacity and permanent wilting point in millimetres of water per centimetre of soil. + +- Drz: Vector, 1-column matrix or data frame defining the root zone depth in centimetres. + +- Kc: Vector, 1-column matrix or data frame defining the crop coefficient. + If NULL its values are assumed to be 1. + +- Irrig: Vector, 1-column matrix or data frame with net irrigation amount infiltrated into the soil for the current day in millimetres. + +- MAD: Vector, 1-column matrix or data frame defining the management allowed depletion. + Varies between 0 and 1. + +- InitialD Single number defining in millimetre, the initial soil water deficit. + It is used to start the water balance accounting. + Default value is 0, which assumes the root zone is at the field capacity. + +- start.date: Date at which the accounting should start. + Formats: “YYYY-MM-DD”, “YYYY/MM/DD”. + +## Value + +- Water balance accounting, including the soil water deficit. + +## Examples + + +``` r +Tavg <- DataForCWB[, 2] +Tmax <- DataForCWB[, 3] +Tmin <- DataForCWB[, 4] +Rn <- DataForCWB[, 6] +WS <- DataForCWB[, 7] +RH <- DataForCWB[, 8] +G <- DataForCWB[, 9] +ET0 <- ET0_PM(Tavg, Tmax, Tmin, Rn, RH, WS, G, Alt = 700) +Rain <- DataForCWB[, 10] +Drz <- DataForCWB[, 11] +AWC <- DataForCWB[, 12] +MAD <- DataForCWB[, 13] +Kc <- DataForCWB[, 14] +Irrig <- DataForCWB[, 15] +head(CWB( + Rain = Rain, + ET0 = ET0, + AWC = AWC, + Drz = Drz, + Kc = Kc, + Irrig = Irrig, + MAD = MAD, + start.date = "2023-11-23" +)) +``` + +``` +## DaysSeason Rain Irrig ET0 Kc WaterStressCoef_Ks ETc (P+Irrig)-ETc NonStandardCropEvap ET_Defict TAW SoilWaterDeficit d_MAD D>=dmad +## 2023-11-22 1 45.5 0 2.4 1 1 2.4 43.0 2.4 0 45.7 0.0 13.7 No +## 2023-11-23 2 0.3 0 4.2 1 1 4.2 -3.9 4.2 0 45.7 3.9 13.7 No +## 2023-11-24 3 0.0 0 4.3 1 1 4.3 -4.3 4.3 0 45.7 8.2 13.7 No +## 2023-11-25 4 11.4 0 3.7 1 1 3.7 7.8 3.7 0 45.7 0.4 13.7 No +## 2023-11-26 5 0.3 0 4.8 1 1 4.8 -4.6 4.8 0 45.7 5.0 13.7 No +## 2023-11-27 6 0.0 0 5.7 1 1 5.7 -5.7 5.7 0 45.7 10.7 13.7 No +``` + +## Function CWB_FixedSchedule() + +Calculates several parameters of the crop water balance. +It also suggests how much irrigate. + +## Usage + + +``` r +CWB_FixedSchedule( + Rain, + ET0, + AWC, + Drz, + Kc = NULL, + Irrig = NULL, + MAD = NULL, + InitialD = 0, + Scheduling, + start.date +) +``` + +## Arguments + +- Rain: Vector, 1-column matrix or data frame with daily rainfall totals in millimetres. + +- ET0: Vector, 1-column matrix or data frame with daily reference evapotranspiration in millimetres. + +- AWC: Vector, 1-column matrix or data frame with the available water capacity of the soil, that is: the amount of water between field capacity and permanent wilting point in millimetre of water per centimetre of soil. + +- Drz: Vector, 1-column matrix or data frame defining the root zone depth in centimetres. + +- Kc: Vector, 1-column matrix or data frame defining the crop coefficient. + If NULL its values are assumed to be 1. + +- Irrig: Vector, 1-column matrix or data frame with net irrigation amount infiltrated into the soil for the current day in millimetres. + +- MAD: Vector, 1-column matrix or data frame defining the management allowed depletion. + Varies between 0 and 1. + +- InitialD Single number defining in millimetre, the initial soil water deficit. + It is used to start the water balance accounting. + Default value is 0, which assumes the root zone is at the field capacity. + +- Scheduling Single integer number defining the number of days between two consecutive irrigations. + +- start.date: Date at which the accounting should start. + Formats: “YYYY-MM-DD”, “YYYY/MM/DD”. + +## Value + +- Water balance accounting, including the soil water deficit. + + +``` r +Tavg <- DataForCWB[, 2] +Tmax <- DataForCWB[, 3] +Tmin <- DataForCWB[, 4] +Rn <- DataForCWB[, 6] +WS <- DataForCWB[, 7] +RH <- DataForCWB[, 8] +G <- DataForCWB[, 9] +ET0 <- ET0_PM(Tavg, Tmax, Tmin, Rn, RH, WS, G, Alt = 700) +Rain <- DataForCWB[, 10] +Drz <- DataForCWB[, 11] +AWC <- DataForCWB[, 12] +MAD <- DataForCWB[, 13] +Kc <- DataForCWB[, 14] +Irrig <- DataForCWB[, 15] +Scheduling <- 5 +head(CWB_FixedSchedule( + Rain = Rain, + ET0 = ET0, + AWC = AWC, + Drz = Drz, + Kc = Kc, + Irrig = Irrig, + MAD = MAD, + Scheduling = Scheduling, + start.date = "2023-11-23" +)) +``` + +``` +## DaysSeason Rain Irrig ET0 Kc WaterStressCoef_Ks ETc (P+Irrig)-ETc NonStandardCropEvap ET_Defict TAW SoilWaterDeficit d_MAD Scheduling +## 2023-11-22 1 45.470 0 2.440 1 1 2.440 43.030 2.440 0 45.72 0.000 13.716 No +## 2023-11-23 2 0.254 0 4.172 1 1 4.172 -3.918 4.172 0 45.72 3.918 13.716 No +## 2023-11-24 3 0.000 0 4.290 1 1 4.290 -4.290 4.290 0 45.72 8.208 13.716 No +## 2023-11-25 4 11.430 0 3.665 1 1 3.665 7.765 3.665 0 45.72 0.444 13.716 No +## 2023-11-26 5 0.254 0 4.849 1 1 4.849 -4.595 4.849 0 45.72 5.038 13.716 Time to Irrigate 5 mm +## 2023-11-27 6 0.000 0 5.670 1 1 5.670 -5.670 5.670 0 45.72 10.708 13.716 No +``` + +## DataForAWC: Soil texture and plant available water capacity (AWC). + +AWC is the amount of water between field capacity and permanent wilting point. +Given in millimetre of water per centimetre of soil. +Extracted from: Irrigation Scheduling: The Water Balance Approach Fact Sheet No. 4.707 by A. +A. Andales, J. L. Chávez, T. A. Bauder.. + +## Usage + + +``` r +DataForAWC +``` + +## Format + +- Soil Texture Soil Texture +- AWC Low Available water capacity in millimetre of water per centimetre of soil +- AWC High Available water capacity in millimetre of water per centimetre of soil +- AWC Average Available water capacity in millimetre of water per centimetre of soil + +## Source + +. + +## Examples + + +``` r +DataForAWC +``` + +``` +## Soil.Texture AWC.Low AWC.High AWC.Average +## 1 Coarse sands 50 70 60 +## 2 Fine sands 70 80 80 +## 3 Loamy sands 70 100 80 +## 4 Sandy loams 100 130 120 +## 5 Fine sandy loams 130 170 150 +## 6 Sandy clay loams 130 180 160 +## 7 Loams 180 210 200 +## 8 Silt loams 170 210 190 +## 9 Silty clay loams 130 170 150 +## 10 Clay loam 130 170 150 +## 11 Silty clay 130 140 130 +## 12 Clay 110 130 120 +``` + +## DataForCWB: Data for Water Balance Accounting. + +Daily meteorological data from a weather station in Campinas, Brazil and other parameters required for calculating the crop water balance. +The meteorological data belongs to the Agronomic Institute of the state of Sao Paulo. + +## Usage + + +``` r +DataForCWB +``` + +## Format + +- A data frame with 129 rows and 16 columns. +- date date +- tmed Average air temperature in Celsius degrees +- tmax Maximum air temperature in Celsius degrees +- tmin Minimum air temperature in Celsius degrees +- Ra Extraterrestrial solar radiation in MJ M-2 DAY-1 +- Rn Net radiation in MJ M-2 DAY-1 +- W Wind speed in M S-1 +- RH Relative Humidity in % +- G Soil Heat Flux in MJ M-2 DAY-1 +- Rain Rain in millimetres +- Drz Depth of the root zone in centimetres +- AWC available water capacity (amount of water between field capacity and permanent wilting point) in millimetre of water per centimetre of soil +- MAD management allowed depletion (between 0 and 1) +- Kc Crop coefficient (between 0 and 1) +- Irrig Applied net irrigation in millimetres + +## Source + +. + +## Examples + + +``` r +head(DataForCWB) +``` + +``` +## Date tmed tmax tmin Ra Rn W RH G Rain Drz AWC MAD Kc Irrig +## 1 11/23/2010 23.000 27.26 18.74 42.07246 6.04422 2.16 76.58 -0.64 45.470 0.3048 150 0.3 1 0 +## 2 11/24/2010 23.730 29.00 18.46 42.12238 11.08968 2.57 64.50 -0.30 0.254 0.3048 150 0.3 1 0 +## 3 11/25/2010 24.650 30.33 18.97 42.17043 12.71410 2.80 70.37 0.19 0.000 0.3048 150 0.3 1 0 +## 4 11/26/2010 24.795 31.46 18.13 42.21660 11.46852 1.86 73.03 0.38 11.430 0.3048 150 0.3 1 0 +## 5 11/27/2010 22.340 27.86 16.82 42.26093 12.89778 2.61 57.80 -0.78 0.254 0.3048 150 0.3 1 0 +## 6 11/28/2010 23.400 30.70 16.10 42.30341 15.02158 2.42 48.06 -0.20 0.000 0.3048 150 0.3 1 0 +``` + +## BugReports: + +\< \> + +## License: + +MIT + +## Authors: + +Gabriel Constantino Blain, Graciela da Rocha Sobierajski, Regina Célia Matos Pires, Adam H. Sparks, Letícia L. Martins. +Maintainer: Gabriel Constantino Blain, [gabriel.blain\@sp.gov.br](mailto:gabriel.blain@sp.gov.br){.email} + +## Acknowledgments: + +The package uses data from the Fact Sheet number 4707 Irrigation Scheduling: The Water Balance Approach, by A. +A. Andales, J. L. Chávez, and T. +A. Bauder. +The authors greatly appreciate this initiative. + +## References + +Allen, R.G.; Pereira, L.S.; Raes, D.; Smith, M. Crop evapotranspiration. +In Guidelines for Computing Crop Water Requirements. +Irrigation and Drainage Paper 56; FAO: Rome, Italy, 1998; p. 300. + +Andales, A.A.; Chávez, J.L.;Bauder, T.A. +2012. +Irrigation Scheduling: The Water Balance Approach. +Fact Sheet number 4707, crop series \| irrigation. + + +Hargreaves, G.H.; Samani, Z.A. +1985.Reference crop evapotranspiration from temperature. +Appl. +Eng. +Agric,1, 96–99. + +Package ‘lubridate', Version 1.9.3, Author Vitalie Spinu et al., + +Package ‘PowerSDI', Version 1.0. +0, Author Gabriel C. Blain et al., + +Priestley, C.H.B., Taylor, R.J., 1972. +On the Assessment of Surface Heat Flux and Evaporation Using Large-Scale Parameters. +Monthly Weather Review, 100 (2), 81–92. \ No newline at end of file diff --git a/src/somef/test/test_data/repositories/cropwater/codemeta.json b/src/somef/test/test_data/repositories/cropwater/codemeta.json new file mode 100644 index 00000000..c2b7c2e5 --- /dev/null +++ b/src/somef/test/test_data/repositories/cropwater/codemeta.json @@ -0,0 +1,159 @@ +{ + "@context": "https://doi.org/10.5063/schema/codemeta-2.0", + "@type": "SoftwareSourceCode", + "identifier": "CropWaterBalance", + "description": "Calculates daily climate water balance for irrigation purposes and also calculates the reference evapotranspiration (ET) using three methods, Penman and Monteith (Allen et al. 1998, ISBN:92-5-104219-5); Priestley and Taylor (1972) ; or Hargreaves and Samani (1985) . Users may specify a management allowed depletion (MAD), which is used to suggest when to irrigate. The functionality allows for the use of crop and water stress coefficients as well.", + "name": "CropWaterBalance: Climate Water Balance for Irrigation Purposes", + "codeRepository": "https://github.com/gabrielblain/CropWaterBalance", + "issueTracker": "https://github.com/gabrielblain/CropWaterBalance/issues", + "license": "https://spdx.org/licenses/MIT", + "version": "0.2.0.9000", + "programmingLanguage": { + "@type": "ComputerLanguage", + "name": "R", + "url": "https://r-project.org" + }, + "runtimePlatform": "R version 4.4.1 (2024-06-14)", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Comprehensive R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + }, + "author": [ + { + "@type": "Person", + "givenName": "Gabriel Constantino", + "familyName": "Blain", + "email": "gabriel.blain@sp.gov.br", + "@id": "https://orcid.org/0000-0001-8832-7734" + }, + { + "@type": "Person", + "givenName": "Graciela R.", + "familyName": "Sobierajski", + "@id": "https://orcid.org/0000-0002-7211-9268" + }, + { + "@type": "Person", + "givenName": "Regina C.", + "familyName": "Matos Pires", + "@id": "https://orcid.org/0000-0003-4200-7094" + }, + { + "@type": "Person", + "givenName": "Adam H.", + "familyName": "Sparks", + "email": "adamhsparks@gmail.com", + "@id": "https://orcid.org/0000-0002-0061-8359" + }, + { + "@type": "Person", + "givenName": "Leticia L.", + "familyName": "Martins", + "@id": "https://orcid.org/0000-0002-0299-3005" + } + ], + "maintainer": [ + { + "@type": "Person", + "givenName": "Gabriel Constantino", + "familyName": "Blain", + "email": "gabriel.blain@sp.gov.br", + "@id": "https://orcid.org/0000-0001-8832-7734" + } + ], + "softwareSuggestions": [ + { + "@type": "SoftwareApplication", + "identifier": "knitr", + "name": "knitr", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Comprehensive R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + }, + "sameAs": "https://CRAN.R-project.org/package=knitr" + }, + { + "@type": "SoftwareApplication", + "identifier": "rmarkdown", + "name": "rmarkdown", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Comprehensive R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + }, + "sameAs": "https://CRAN.R-project.org/package=rmarkdown" + }, + { + "@type": "SoftwareApplication", + "identifier": "spelling", + "name": "spelling", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Comprehensive R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + }, + "sameAs": "https://CRAN.R-project.org/package=spelling" + }, + { + "@type": "SoftwareApplication", + "identifier": "testthat", + "name": "testthat", + "version": ">= 3.0.0", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Comprehensive R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + }, + "sameAs": "https://CRAN.R-project.org/package=testthat" + } + ], + "softwareRequirements": { + "1": { + "@type": "SoftwareApplication", + "identifier": "R", + "name": "R", + "version": ">= 3.10" + }, + "2": { + "@type": "SoftwareApplication", + "identifier": "PowerSDI", + "name": "PowerSDI", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Comprehensive R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + }, + "sameAs": "https://CRAN.R-project.org/package=PowerSDI" + }, + "3": { + "@type": "SoftwareApplication", + "identifier": "lubridate", + "name": "lubridate", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Comprehensive R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + }, + "sameAs": "https://CRAN.R-project.org/package=lubridate" + }, + "4": { + "@type": "SoftwareApplication", + "identifier": "stats", + "name": "stats" + }, + "SystemRequirements": null + }, + "fileSize": "176.519KB", + "releaseNotes": "https://github.com/gabrielblain/CropWaterBalance/blob/master/NEWS.md", + "readme": "https://github.com/gabrielblain/CropWaterBalance/blob/master/README.md", + "contIntegration": ["https://github.com/gabrielblain/CropWaterBalance/actions/workflows/R-CMD-check.yaml", "https://github.com/adamhsparks/CropWaterBalance/actions/workflows/R-CMD-check.yaml"] +} \ No newline at end of file diff --git a/src/somef/test/test_data/repositories/ggstatsplot/DESCRIPTION b/src/somef/test/test_data/repositories/ggstatsplot/DESCRIPTION new file mode 100644 index 00000000..456128ba --- /dev/null +++ b/src/somef/test/test_data/repositories/ggstatsplot/DESCRIPTION @@ -0,0 +1,86 @@ +Type: Package +Package: ggstatsplot +Title: 'ggplot2' Based Plots with Statistical Details +Version: 0.1.0.9000 +Authors@R: + c(person(given = "Indrajeet", + family = "Patil", + role = c("cre", "aut", "ctb"), + email = "patilindrajeet.science@gmail.com", + comment = c(ORCID = "0000-0003-1995-6531")), + person(given = "Chuck", + family = "Powell", + role = "ctb", + email = "ibecav@gmail.com", + comment = c(ORCID = "0000-0002-3606-2188"))) +Maintainer: Indrajeet Patil +Description: Extension of 'ggplot2', 'ggstatsplot' creates + graphics with details from statistical tests included in the plots + themselves. It is targeted primarily at behavioral sciences community + to provide a one-line code to generate information-rich plots for + statistical analysis of continuous (violin plots, scatterplots, + histograms, dot plots, dot-and-whisker plots) or categorical (pie and + bar charts) data. Currently, it supports only the most common types of + statistical tests: parametric, nonparametric, robust, and bayesian + versions of t-test/anova, correlation analyses, contingency table + analysis, and regression analyses. +License: GPL-3 | file LICENSE +URL: https://indrajeetpatil.github.io/ggstatsplot/, + https://github.com/IndrajeetPatil/ggstatsplot +BugReports: https://github.com/IndrajeetPatil/ggstatsplot/issues +Depends: + R (>= 3.5.0) +Imports: + broomExtra (>= 0.0.4), + cowplot (>= 1.0.0), + crayon (>= 1.3.4), + dplyr (>= 0.8.3), + ellipsis (>= 0.2.0.1), + ggcorrplot (>= 0.1.3), + ggExtra (>= 0.8), + ggplot2 (>= 3.2.1), + ggrepel (>= 0.8.1), + ggsignif (>= 0.6.0), + grid, + groupedstats (>= 0.0.8.9000), + magrittr (>= 1.5), + metaBMA (>= 0.6.1), + metafor (>= 2.1-0), + pairwiseComparisons (>= 0.0.1), + paletteer (>= 0.2.1), + psych (>= 1.8.12), + purrr (>= 0.3.2), + purrrlyr (>= 0.0.5), + rlang (>= 0.4.0), + scales (>= 1.0.0), + sjstats (>= 0.17.5), + stats, + statsExpressions (>= 0.1.0), + tibble (>= 2.1.3), + tidyr (>= 0.8.3), + WRS2 +Suggests: + broom, + broom.mixed, + forcats, + jmv, + knitr, + lme4, + MASS, + MCMCglmm, + ordinal, + rmarkdown, + spelling, + stringr, + survival, + testthat +VignetteBuilder: + knitr +Remotes: + IndrajeetPatil/groupedstats, + IndrajeetPatil/pairwiseComparisons +Encoding: UTF-8 +Language: en-US +LazyData: true +Roxygen: list(markdown = TRUE) +RoxygenNote: 6.1.1.9000 \ No newline at end of file diff --git a/src/somef/test/test_data/repositories/ggstatsplot/codemeta.json b/src/somef/test/test_data/repositories/ggstatsplot/codemeta.json new file mode 100644 index 00000000..48e80bf4 --- /dev/null +++ b/src/somef/test/test_data/repositories/ggstatsplot/codemeta.json @@ -0,0 +1,638 @@ +{ + "@context": [ + "https://doi.org/10.5063/schema/codemeta-2.0", + "http://schema.org" + ], + "@type": "SoftwareSourceCode", + "identifier": "ggstatsplot", + "description": "Extension of 'ggplot2', 'ggstatsplot' creates\n graphics with details from statistical tests included in the plots\n themselves. It is targeted primarily at behavioral sciences community\n to provide a one-line code to generate information-rich plots for\n statistical analysis of continuous (violin plots, scatterplots,\n histograms, dot plots, dot-and-whisker plots) or categorical (pie and\n bar charts) data. Currently, it supports only the most common types of\n statistical tests: parametric, nonparametric, robust, and bayesian\n versions of t-test/anova, correlation analyses, contingency table\n analysis, and regression analyses.", + "name": "ggstatsplot: 'ggplot2' Based Plots with Statistical Details", + "codeRepository": "https://github.com/IndrajeetPatil/ggstatsplot", + "relatedLink": [ + "https://indrajeetpatil.github.io/ggstatsplot/", + "https://CRAN.R-project.org/package=ggstatsplot" + ], + "issueTracker": "https://github.com/IndrajeetPatil/ggstatsplot/issues", + "license": "https://spdx.org/licenses/GPL-3.0", + "version": "0.1.0.9000", + "programmingLanguage": { + "@type": "ComputerLanguage", + "name": "R", + "version": "3.6.1", + "url": "https://r-project.org" + }, + "runtimePlatform": "R version 3.6.1 (2019-07-05)", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Comprehensive R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + }, + "author": [ + { + "@type": "Person", + "givenName": "Indrajeet", + "familyName": "Patil", + "email": "patilindrajeet.science@gmail.com", + "@id": "https://orcid.org/0000-0003-1995-6531" + } + ], + "contributor": [ + { + "@type": "Person", + "givenName": "Indrajeet", + "familyName": "Patil", + "email": "patilindrajeet.science@gmail.com", + "@id": "https://orcid.org/0000-0003-1995-6531" + }, + { + "@type": "Person", + "givenName": "Chuck", + "familyName": "Powell", + "email": "ibecav@gmail.com", + "@id": "https://orcid.org/0000-0002-3606-2188" + } + ], + "maintainer": [ + { + "@type": "Person", + "givenName": "Indrajeet", + "familyName": "Patil", + "email": "patilindrajeet.science@gmail.com", + "@id": "https://orcid.org/0000-0003-1995-6531" + } + ], + "softwareSuggestions": [ + { + "@type": "SoftwareApplication", + "identifier": "broom", + "name": "broom", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Comprehensive R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + }, + "sameAs": "https://CRAN.R-project.org/package=broom" + }, + { + "@type": "SoftwareApplication", + "identifier": "broom.mixed", + "name": "broom.mixed", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Comprehensive R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + }, + "sameAs": "https://CRAN.R-project.org/package=broom.mixed" + }, + { + "@type": "SoftwareApplication", + "identifier": "forcats", + "name": "forcats", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Comprehensive R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + }, + "sameAs": "https://CRAN.R-project.org/package=forcats" + }, + { + "@type": "SoftwareApplication", + "identifier": "jmv", + "name": "jmv", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Comprehensive R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + }, + "sameAs": "https://CRAN.R-project.org/package=jmv" + }, + { + "@type": "SoftwareApplication", + "identifier": "knitr", + "name": "knitr", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Comprehensive R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + }, + "sameAs": "https://CRAN.R-project.org/package=knitr" + }, + { + "@type": "SoftwareApplication", + "identifier": "lme4", + "name": "lme4", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Comprehensive R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + }, + "sameAs": "https://CRAN.R-project.org/package=lme4" + }, + { + "@type": "SoftwareApplication", + "identifier": "MASS", + "name": "MASS", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Comprehensive R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + }, + "sameAs": "https://CRAN.R-project.org/package=MASS" + }, + { + "@type": "SoftwareApplication", + "identifier": "MCMCglmm", + "name": "MCMCglmm", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Comprehensive R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + }, + "sameAs": "https://CRAN.R-project.org/package=MCMCglmm" + }, + { + "@type": "SoftwareApplication", + "identifier": "ordinal", + "name": "ordinal", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Comprehensive R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + }, + "sameAs": "https://CRAN.R-project.org/package=ordinal" + }, + { + "@type": "SoftwareApplication", + "identifier": "rmarkdown", + "name": "rmarkdown", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Comprehensive R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + }, + "sameAs": "https://CRAN.R-project.org/package=rmarkdown" + }, + { + "@type": "SoftwareApplication", + "identifier": "spelling", + "name": "spelling", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Comprehensive R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + }, + "sameAs": "https://CRAN.R-project.org/package=spelling" + }, + { + "@type": "SoftwareApplication", + "identifier": "stringr", + "name": "stringr", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Comprehensive R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + }, + "sameAs": "https://CRAN.R-project.org/package=stringr" + }, + { + "@type": "SoftwareApplication", + "identifier": "survival", + "name": "survival", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Comprehensive R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + }, + "sameAs": "https://CRAN.R-project.org/package=survival" + }, + { + "@type": "SoftwareApplication", + "identifier": "testthat", + "name": "testthat", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Comprehensive R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + }, + "sameAs": "https://CRAN.R-project.org/package=testthat" + } + ], + "softwareRequirements": [ + { + "@type": "SoftwareApplication", + "identifier": "R", + "name": "R", + "version": ">= 3.5.0" + }, + { + "@type": "SoftwareApplication", + "identifier": "broomExtra", + "name": "broomExtra", + "version": ">= 0.0.4", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Comprehensive R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + }, + "sameAs": "https://CRAN.R-project.org/package=broomExtra" + }, + { + "@type": "SoftwareApplication", + "identifier": "cowplot", + "name": "cowplot", + "version": ">= 1.0.0", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Comprehensive R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + }, + "sameAs": "https://CRAN.R-project.org/package=cowplot" + }, + { + "@type": "SoftwareApplication", + "identifier": "crayon", + "name": "crayon", + "version": ">= 1.3.4", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Comprehensive R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + }, + "sameAs": "https://CRAN.R-project.org/package=crayon" + }, + { + "@type": "SoftwareApplication", + "identifier": "dplyr", + "name": "dplyr", + "version": ">= 0.8.3", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Comprehensive R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + }, + "sameAs": "https://CRAN.R-project.org/package=dplyr" + }, + { + "@type": "SoftwareApplication", + "identifier": "ellipsis", + "name": "ellipsis", + "version": ">= 0.2.0.1", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Comprehensive R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + }, + "sameAs": "https://CRAN.R-project.org/package=ellipsis" + }, + { + "@type": "SoftwareApplication", + "identifier": "ggcorrplot", + "name": "ggcorrplot", + "version": ">= 0.1.3", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Comprehensive R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + }, + "sameAs": "https://CRAN.R-project.org/package=ggcorrplot" + }, + { + "@type": "SoftwareApplication", + "identifier": "ggExtra", + "name": "ggExtra", + "version": ">= 0.8", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Comprehensive R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + }, + "sameAs": "https://CRAN.R-project.org/package=ggExtra" + }, + { + "@type": "SoftwareApplication", + "identifier": "ggplot2", + "name": "ggplot2", + "version": ">= 3.2.1", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Comprehensive R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + }, + "sameAs": "https://CRAN.R-project.org/package=ggplot2" + }, + { + "@type": "SoftwareApplication", + "identifier": "ggrepel", + "name": "ggrepel", + "version": ">= 0.8.1", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Comprehensive R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + }, + "sameAs": "https://CRAN.R-project.org/package=ggrepel" + }, + { + "@type": "SoftwareApplication", + "identifier": "ggsignif", + "name": "ggsignif", + "version": ">= 0.6.0", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Comprehensive R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + }, + "sameAs": "https://CRAN.R-project.org/package=ggsignif" + }, + { + "@type": "SoftwareApplication", + "identifier": "grid", + "name": "grid" + }, + { + "@type": "SoftwareApplication", + "identifier": "groupedstats", + "name": "groupedstats", + "version": ">= 0.0.8.9000", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Comprehensive R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + }, + "sameAs": "https://github.com/IndrajeetPatil/groupedstats" + }, + { + "@type": "SoftwareApplication", + "identifier": "magrittr", + "name": "magrittr", + "version": ">= 1.5", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Comprehensive R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + }, + "sameAs": "https://CRAN.R-project.org/package=magrittr" + }, + { + "@type": "SoftwareApplication", + "identifier": "metaBMA", + "name": "metaBMA", + "version": ">= 0.6.1", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Comprehensive R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + }, + "sameAs": "https://CRAN.R-project.org/package=metaBMA" + }, + { + "@type": "SoftwareApplication", + "identifier": "metafor", + "name": "metafor", + "version": ">= 2.1-0", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Comprehensive R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + }, + "sameAs": "https://CRAN.R-project.org/package=metafor" + }, + { + "@type": "SoftwareApplication", + "identifier": "pairwiseComparisons", + "name": "pairwiseComparisons", + "version": ">= 0.0.1", + "sameAs": "https://github.com/IndrajeetPatil/pairwiseComparisons" + }, + { + "@type": "SoftwareApplication", + "identifier": "paletteer", + "name": "paletteer", + "version": ">= 0.2.1", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Comprehensive R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + }, + "sameAs": "https://CRAN.R-project.org/package=paletteer" + }, + { + "@type": "SoftwareApplication", + "identifier": "psych", + "name": "psych", + "version": ">= 1.8.12", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Comprehensive R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + }, + "sameAs": "https://CRAN.R-project.org/package=psych" + }, + { + "@type": "SoftwareApplication", + "identifier": "purrr", + "name": "purrr", + "version": ">= 0.3.2", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Comprehensive R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + }, + "sameAs": "https://CRAN.R-project.org/package=purrr" + }, + { + "@type": "SoftwareApplication", + "identifier": "purrrlyr", + "name": "purrrlyr", + "version": ">= 0.0.5", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Comprehensive R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + }, + "sameAs": "https://CRAN.R-project.org/package=purrrlyr" + }, + { + "@type": "SoftwareApplication", + "identifier": "rlang", + "name": "rlang", + "version": ">= 0.4.0", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Comprehensive R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + }, + "sameAs": "https://CRAN.R-project.org/package=rlang" + }, + { + "@type": "SoftwareApplication", + "identifier": "scales", + "name": "scales", + "version": ">= 1.0.0", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Comprehensive R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + }, + "sameAs": "https://CRAN.R-project.org/package=scales" + }, + { + "@type": "SoftwareApplication", + "identifier": "sjstats", + "name": "sjstats", + "version": ">= 0.17.5", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Comprehensive R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + }, + "sameAs": "https://CRAN.R-project.org/package=sjstats" + }, + { + "@type": "SoftwareApplication", + "identifier": "stats", + "name": "stats" + }, + { + "@type": "SoftwareApplication", + "identifier": "statsExpressions", + "name": "statsExpressions", + "version": ">= 0.1.0", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Comprehensive R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + }, + "sameAs": "https://CRAN.R-project.org/package=statsExpressions" + }, + { + "@type": "SoftwareApplication", + "identifier": "tibble", + "name": "tibble", + "version": ">= 2.1.3", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Comprehensive R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + }, + "sameAs": "https://CRAN.R-project.org/package=tibble" + }, + { + "@type": "SoftwareApplication", + "identifier": "tidyr", + "name": "tidyr", + "version": ">= 0.8.3", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Comprehensive R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + }, + "sameAs": "https://CRAN.R-project.org/package=tidyr" + }, + { + "@type": "SoftwareApplication", + "identifier": "WRS2", + "name": "WRS2", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Comprehensive R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + }, + "sameAs": "https://CRAN.R-project.org/package=WRS2" + } + ], + "releaseNotes": "https://github.com/IndrajeetPatil/ggstatsplot/blob/master/NEWS.md", + "contIntegration": [ + "https://travis-ci.org/IndrajeetPatil/ggstatsplot", + "https://ci.appveyor.com/project/IndrajeetPatil/ggstatsplot", + "https://coveralls.io/github/IndrajeetPatil/ggstatsplot?branch=master", + "https://codecov.io/gh/IndrajeetPatil/ggstatsplot?branch=master" + ], + "developmentStatus": "https://www.tidyverse.org/lifecycle/", + "keywords": [ + "ggplot-extension", + "statistical-tests", + "dataviz", + "r", + "statistical-analysis", + "statistical-inference", + "visualization", + "datascience", + "violin-plot", + "parametric", + "robust", + "plot", + "bayes-factors", + "regression-models", + "correlation", + "correlation-matrices", + "tidy-data", + "effect-size", + "mixed-models", + "statistical-measures", + "robust-statistics", + "non-parametric-statistics", + "meta-analysis" + ], + "citation": [ + { + "@type": "SoftwareSourceCode", + "datePublished": "2018", + "author": [ + { + "@type": "Person", + "givenName": "Indrajeet", + "familyName": "Patil" + } + ], + "name": "ggstatsplot: 'ggplot2' Based Plots with Statistical Details", + "identifier": "10.5281/zenodo.2074621", + "url": "https://CRAN.R-project.org/package=ggstatsplot", + "@id": "https://doi.org/10.5281/zenodo.2074621", + "sameAs": "https://doi.org/10.5281/zenodo.2074621" + } + ], + "copyrightHolder": {}, + "funder": {}, + "readme": "https://github.com/IndrajeetPatil/ggstatsplot/blob/master/README.md" +} \ No newline at end of file diff --git a/src/somef/test/test_data/repositories/workloopr/LICENSE b/src/somef/test/test_data/repositories/workloopr/LICENSE new file mode 100644 index 00000000..e72bfdda --- /dev/null +++ b/src/somef/test/test_data/repositories/workloopr/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. \ No newline at end of file diff --git a/src/somef/test/test_data/repositories/workloopr/README.md b/src/somef/test/test_data/repositories/workloopr/README.md new file mode 100644 index 00000000..72405172 --- /dev/null +++ b/src/somef/test/test_data/repositories/workloopr/README.md @@ -0,0 +1,172 @@ +workloopR +======================================================================================= + + +[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active) [![AppVeyor build status](https://ci.appveyor.com/api/projects/status/github/vbaliga/workloopR?branch=master&svg=true)](https://ci.appveyor.com/project/vbaliga/workloopR) [![Travis build status](https://travis-ci.org/vbaliga/workloopR.svg?branch=master)](https://travis-ci.org/vbaliga/workloopR) + + +Analysis of work loops and other data from muscle physiology experiments in R + + + +## Installation + +We are not (yet) on CRAN but the package can be installed via: +``` r +#install.packages("devtools") # if devtools is not installed +devtools::install_github("vbaliga/workloopR") +``` + + + +## Overview + +`workloopR` (pronounced "work looper") provides functions for the import, transformation, and analysis of muscle physiology experiments in R. As the package's title suggests, our initial motivation was to provide functions to analyze work loops. The work loop technique ([Josephson 1985](https://jeb.biologists.org/content/114/1/493)) is used in studies of muscle physiology to determine the mechanical work and power output of a muscle. Over the course of developing the package, we expanded this goal to also cover experiments that are often complementary to the work loop technique. There are three currently supported experiment types: work loop, simple twitch, and tetanus. + +![Figure 1](images/fig1_workloop.png) + +For more on work loops, we recommend a great review paper by Ahn ([2012](https://dx.doi.org/10.1242/jeb.062752)) as well as [this](https://en.wikipedia.org/wiki/Work_loop) Wikipedia page. + + + +## Example + +`workloopR` offers the ability to import, transform, and then analyze a data file. Here is an example using a work loop file included within the package: + +```r +library(workloopR) + +## import the workloop.ddf file included in workloopR +wl_dat <- read_ddf(system.file("extdata", "workloop.ddf", + package = 'workloopR'), + phase_from_peak = TRUE) + +## select cycles 3 through 5 using a peak-to-peak definition +wl_selected <- select_cycles(wl_dat, cycle_def = "p2p", keep_cycles = 3:5) + +## apply a gear ratio correction, run the analysis function, +## and then get the full object +wl_analyzed <- analyze_workloop(wl_selected, GR = 2) +## for brevity, the print() method for this object produces a simple output +wl_analyzed +``` + File ID: workloop.ddf + Cycles: 3 cycles kept out of 6 + Mean Work: 0.00308 J + Mean Power: 0.08474 W +```r +## but see the structure for the full output, e.g. +#str(wl_analyzed) + +## or run the analysis but get the simplified version +wl_analyzed_simple <- analyze_workloop(wl_selected, simplify = TRUE, GR = 2) +wl_analyzed_simple +``` + Cycle Work Net_Power + a A 0.002785397 0.07639783 + b B 0.003147250 0.08661014 + c C 0.003305744 0.09122522 + + + +## Core features and recommended vignettes + +*For an overview, please also see our "Introduction to workloopR" vignette* + +**Data import**: Importing data creates objects of class `muscle_stim`, which we designed to essentially behave as `data.frame`s but with unique properties that work nicely with ``workloopR``'s core functions. Data that are stored in .ddf format (e.g. generated by Aurora Scientific's Dynamic Muscle Control and Analysis Software) are easily imported. Other file formats are welcome, but need to be constructed into `muscle_stim` objects by the user; please see the vignette "Importing data from non .ddf sources". + +- Example: + +```R +## import the workloop.ddf file included in workloopR +wl_dat <- read_ddf(system.file("extdata", "workloop.ddf", + package = 'workloopR'), + phase_from_peak = TRUE) + +## see how the muscle_stim object is organized +wl_dat +str(wl_dat) +names(attributes(wl_dat)) +``` + + +**Data transformations & corrections**: Prior to analyses, data can be transformed or corrected. Should data have been recorded incorrectly, the gear ratio of the motor arm and/or the direction of the muscle's length change can be adjusted. Before analyzing work loop data, cycles within the work loop can be labeled (according to various definitions of what constitutes a "cycle"), which allows calculation of metrics on a per-cycle basis. + +- Example: + +```R +## correct the gear ratio of the motor arm +## we'll use gear ratio = 2 +## this multiples Force by 2 and divides Position by 2 +wl_fixed <- fix_GR(wl_dat, GR = 2) +``` + + +**Analyses**: Core data analytical functions include ``analyze_workloop()`` for work loop files and ``isometric_timing()`` for twitch and tetanus trials. + +- ``analyze_workloop()`` computes instantaneous velocity, net work, instantaneous power, and net power for work loop trials on a per-cycle basis. See the "Analyzing work loop experiments in workloopR" vignette. + +- ``isometric_timing()`` provides summarization of kinetics, i.e. the timing and magnitude of force production at various points within the tetanus or twitch trial. See the "Working with isometric experiments in workloopR" vignette. + +- Example: + +```R +## import the twitch.ddf file included in workloopR +twitch_dat <- read_ddf(system.file("extdata", "twitch.ddf", + package = 'workloopR')) + +## run isometric_timing() to get info on twitch kinetics +## we'll use different set points than the defaults +analyze_twitch <- isometric_timing(twitch_dat, + rising = c(25, 50, 75), + relaxing = c(75, 50, 25)) +``` + + +**Batch processing**: We also include functions for batch processing files (e.g. multiple files from a common experiment). These functions allow for the import, cycle selection, gear ratio correction, and ultimately work & power computation for all work loop trial files within a specified directory. This also allows users to correct for potential degradation of the muscle (according to power & work output) over the course of the experiment. See the "Batch processing" vignette + +- Example: + +```R +## batch read and analyze files included with workloopR +analyzed_wls <- read_analyze_wl_dir(system.file("extdata/wl_duration_trials", + package = 'workloopR'), + phase_from_peak = TRUE, + cycle_def = "p2p", keep_cycles = 2:4, + GR = 2) +``` + + +**Plotting**: Although we do not provide plotting functions, all resultant objects are designed to be friendly to visualization via either base-R plotting or `tidyverse` functions. Please see the "Plotting data in workloopR" vignette. + + + +## Graphical overview + +Recommended functions and vignettes: + +![Figure 2](images/fig2_flowchart.png) + + + +## Citation + +The currently preferred way to cite (but subject to change): + +Baliga VB, Senthivasan S (2019). _workloopR: Analysis of Work Loops and Other Data from Muscle +Physiology Experiments_. R package version +19.07.19, . + + + +## Issues/questions/requests + +Feedback is welcome! Please feel free to get in touch with either Vikram ([@vbaliga](https://github.com/vbaliga)) or Shree ([@shreeramsenthi](https://github.com/shreeramsenthi)). + +🐢 + + + +## License + +GPL (>= 3) + file LICENSE \ No newline at end of file diff --git a/src/somef/test/test_data/repositories/workloopr/codemeta.json b/src/somef/test/test_data/repositories/workloopr/codemeta.json new file mode 100644 index 00000000..6228b246 --- /dev/null +++ b/src/somef/test/test_data/repositories/workloopr/codemeta.json @@ -0,0 +1,144 @@ +{ + "@context": [ + "https://doi.org/10.5063/schema/codemeta-2.0", + "http://schema.org" + ], + "@type": "SoftwareSourceCode", + "identifier": "workloopR", + "description": "Functions for the import, transformation, and analysis of data from muscle physiology experiments. The work loop technique is used to evaluate the mechanical work and power output of muscle. Josephson (1985) modernized the technique for application in comparative biomechanics. Although our initial motivation was to provide functions to analyze work loop experiment data, as we developed the package we incorporated the ability to analyze data from experiments that are often complementary to work loops. There are currently three supported experiment types: work loops, simple twitches, and tetanus trials. Data can be imported directly from .ddf files or via an object constructor function. Through either method, data can then be cleaned or transformed via methods typically used in studies of muscle physiology. Data can then be analyzed to determine the timing and magnitude of force development and relaxation (for isometric trials) or the magnitude of work, net power, and instantaneous power among other things (for work loops). Although we do not provide plotting functions, all resultant objects are designed to be friendly to visualization via either base-R plotting or 'tidyverse' functions.", + "name": "workloopR: Analysis of Work Loops and Other Data from Muscle Physiology Experiments", + "license": "https://spdx.org/licenses/GPL-3.0", + "version": "1.0.1", + "programmingLanguage": { + "@type": "ComputerLanguage", + "name": "R", + "version": "3.6.1", + "url": "https://r-project.org" + }, + "runtimePlatform": "R version 3.6.1 (2019-07-05)", + "author": [ + { + "@type": "Person", + "givenName": "Vikram B.", + "familyName": "Baliga", + "email": "vbaliga87@gmail.com", + "@id": "https://orcid.org/0000-0002-9367-8974" + }, + { + "@type": "Person", + "givenName": "Shreeram", + "familyName": "Senthivasan", + "email": "shreeramsenthi@gmail.com", + "@id": "https://orcid.org/0000-0002-7118-9547" + } + ], + "contributor": {}, + "copyrightHolder": {}, + "funder": {}, + "maintainer": [ + { + "@type": "Person", + "givenName": "Vikram B.", + "familyName": "Baliga", + "email": "vbaliga87@gmail.com", + "@id": "https://orcid.org/0000-0002-9367-8974" + } + ], + "softwareSuggestions": [ + { + "@type": "SoftwareApplication", + "identifier": "testthat", + "name": "testthat", + "version": ">= 2.1.1", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Comprehensive R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + }, + "sameAs": "https://CRAN.R-project.org/package=testthat" + }, + { + "@type": "SoftwareApplication", + "identifier": "knitr", + "name": "knitr", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Comprehensive R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + }, + "sameAs": "https://CRAN.R-project.org/package=knitr" + }, + { + "@type": "SoftwareApplication", + "identifier": "rmarkdown", + "name": "rmarkdown", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Comprehensive R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + }, + "sameAs": "https://CRAN.R-project.org/package=rmarkdown" + } + ], + "softwareRequirements": [ + { + "@type": "SoftwareApplication", + "identifier": "pracma", + "name": "pracma", + "version": ">= 2.0.7", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Comprehensive R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + }, + "sameAs": "https://CRAN.R-project.org/package=pracma" + }, + { + "@type": "SoftwareApplication", + "identifier": "signal", + "name": "signal", + "version": ">= 0.7-6", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Comprehensive R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + }, + "sameAs": "https://CRAN.R-project.org/package=signal" + } + ], + "codeRepository": "https://github.com/vbaliga/workloopR", + "fileSize": "873.059KB", + "citation": [ + { + "@type": "SoftwareSourceCode", + "datePublished": "2019", + "author": [ + { + "@type": "Person", + "givenName": "Vikram B.", + "familyName": "Baliga" + }, + { + "@type": "Person", + "givenName": "Shreeram", + "familyName": "Senthivasan" + } + ], + "name": "workloopR: Analysis of Work Loops and Other Data from Muscle Physiology Experiments", + "url": "https://github.com/vbaliga/workloopR" + } + ], + "issueTracker": "https://github.com/vbaliga/workloopR/issues", + "readme": "https://github.com/vbaliga/workloopR/blob/master/README.md", + "contIntegration": [ + "https://ci.appveyor.com/project/vbaliga/workloopR", + "https://travis-ci.org/vbaliga/workloopR" + ], + "developmentStatus": "https://www.repostatus.org/#wip", + "releaseNotes": "https://github.com/vbaliga/workloopR/blob/master/NEWS.md" +} \ No newline at end of file diff --git a/src/somef/test/test_header_analysis.py b/src/somef/test/test_header_analysis.py index 6df7e4eb..b5259205 100644 --- a/src/somef/test/test_header_analysis.py +++ b/src/somef/test/test_header_analysis.py @@ -134,3 +134,18 @@ def test_issue_564(self): citation_text = citations[0][constants.PROP_RESULT][constants.PROP_VALUE] assert "Tim Berners-Lee" in citation_text + + def test_extract_headers_with_separators(self): + """Tests that headers underlined with separators (---) are correctly parsed + and not marked as False due to
being mistaken for a header element.""" + + with open(test_data_path + "README-laueNN.md", "r") as data_file: + text = data_file.read() + result, non_header_content = extract_header_content(text) + print(result) + assert len(result.index) == 11 + + headers = result['Header'].tolist() + assert 'Installation' in headers + assert 'Citation' in headers + assert 'Funding' in headers