Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Merge common and specific code-templates #260

Merged
merged 25 commits into from
Jun 23, 2023

Conversation

theory-in-progress
Copy link
Contributor

Description

Merge common and Specific code-templates

  • Modified the code in fetchTemplates so that any live updates from vue in genCode is not overwritten
  • Dynamically fetches the common code if the file exists, else proceeds with the code from specific file
  • Created new function mergeCode to merge codes from specific and common templates using ejs, the code tag being #:::- replace_here :::#
  • The function takes in strings of specific file and common file and returns the rendered code using ejs
  • The code tag is present in specific template which will be replaced with the code from common template

Feature Request


What is the purpose of this pull request?

  • Bug fix
  • New feature
  • Other

- Merges the common template into specific template
- Uses replace in js to find the tag and replace with the common code
- Uses ejs to render
- Modified the code in fetchTemplates so that any live updates from vue
	in genCode is not overwritten
- Dynamically fetches the common code if the file exists, else proceeds
	with the code from specific file
- Created new function mergeCode to merge codes from specific and common
	templates using ejs, the code tag being `#:::- replace_here :::#`
- The function takes in strings of specific file and common file and
	returns the rendered code using ejs
- The code tag is present in specific template which will be replaced with
	the code from common template
@netlify
Copy link

netlify bot commented Jun 20, 2023

👷 Deploy request for code-generator pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit eb75d1d

theory-in-progress and others added 4 commits June 20, 2023 20:20
…mon-template

- The if else statements throw an error when replace ejs code-tag is present
	in the specific file, but the common file is also missing in the common
	template
- This handles the error by just replacing the replace_here tag with
	an empty string, since this tag is not defined for the second render
* chore(deps): bump playwright-chromium from 1.33.0 to 1.35.1 (pytorch-ignite#255)

Bumps [playwright-chromium](https://github.com/Microsoft/playwright) from 1.33.0 to 1.35.1.
- [Release notes](https://github.com/Microsoft/playwright/releases)
- [Commits](microsoft/playwright@v1.33.0...v1.35.1)

---
updated-dependencies:
- dependency-name: playwright-chromium
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump semver from 7.3.5 to 7.5.2 (pytorch-ignite#254)

Bumps [semver](https://github.com/npm/node-semver) from 7.3.5 to 7.5.2.
- [Release notes](https://github.com/npm/node-semver/releases)
- [Changelog](https://github.com/npm/node-semver/blob/main/CHANGELOG.md)
- [Commits](npm/node-semver@v7.3.5...v7.5.2)

---
updated-dependencies:
- dependency-name: semver
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: vfdev <vfdev.5@gmail.com>

* chore(deps): bump ejs from 3.1.6 to 3.1.9 (pytorch-ignite#253)

Bumps [ejs](https://github.com/mde/ejs) from 3.1.6 to 3.1.9.
- [Release notes](https://github.com/mde/ejs/releases)
- [Commits](mde/ejs@v3.1.6...v3.1.9)

---
updated-dependencies:
- dependency-name: ejs
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump prismjs from 1.26.0 to 1.29.0 (pytorch-ignite#245)

Bumps [prismjs](https://github.com/PrismJS/prism) from 1.26.0 to 1.29.0.
- [Release notes](https://github.com/PrismJS/prism/releases)
- [Changelog](https://github.com/PrismJS/prism/blob/master/CHANGELOG.md)
- [Commits](PrismJS/prism@v1.26.0...v1.29.0)

---
updated-dependencies:
- dependency-name: prismjs
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump @vitejs/plugin-vue from 2.1.0 to 2.3.4 (pytorch-ignite#251)

Bumps [@vitejs/plugin-vue](https://github.com/vitejs/vite-plugin-vue/tree/HEAD/packages/plugin-vue) from 2.1.0 to 2.3.4.
- [Release notes](https://github.com/vitejs/vite-plugin-vue/releases)
- [Changelog](https://github.com/vitejs/vite-plugin-vue/blob/main/packages/plugin-vue/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite-plugin-vue/commits/HEAD/packages/plugin-vue)

---
updated-dependencies:
- dependency-name: "@vitejs/plugin-vue"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: vfdev <vfdev.5@gmail.com>

* Restructured config (pytorch-ignite#243)

* Restructured config

- Restructured config so that arguments are defined in cofing.yaml

* Fix main.py

* MOdified tests according to new config restructuring

* Updating remaining templates with restructured config

* Update according to original config args

* Configs for all the templates

- Created new yaml files for testing the code
- These are the test args that will be run when we run the tests

* Modified tests according to new config structure

* Fix typo

* Correct backend argument to be passed in command line

* Pass backend argument as a command line argument

* Modifying the config structure in template-common

---------

Co-authored-by: vfdev <vfdev.5@gmail.com>

* chore(deps): bump prettier from 2.5.1 to 2.8.8 (pytorch-ignite#259)

Bumps [prettier](https://github.com/prettier/prettier) from 2.5.1 to 2.8.8.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](prettier/prettier@2.5.1...2.8.8)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: vfdev <vfdev.5@gmail.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: vfdev <vfdev.5@gmail.com>
src/store.js Outdated Show resolved Hide resolved
theory-in-progress and others added 17 commits June 21, 2023 15:47
- Removes the repeating code in the specific templates
- The common code is stored in src/templates/template-common
- Removes the repeating code in the specific templates
- The common code is stored in src/templates/template-common
- Removes the repeating code in the specific templates
- The common code is stored in src/templates/template-common
- added min_lint
- flake8 tests now run on the rendered code in dist-tests/
- We do not need the script now since the code from common and specific
	don't have an intersection now
…_template_common ::#` handle flake import errors

- Changed the code tags to match `.replace()`
- handled the flake import errors by including if else statements using ejs rendering
- Modified tests to check if rendered code is present and unzipped
- Modified imports to include `Engine`
- Modified workflow so that dir `dist-tests` are removed
- added __DEV_CONFIG__.json to prettierignore
- start dev server on port 5000
- add F821 non imported objects to flake8 tests
- utils Formatting
- trainers Formatting
Copy link
Member

@vfdev-5 vfdev-5 left a comment

Choose a reason for hiding this comment

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

Thanks a lot, @theory-in-progress, LGTM!

@vfdev-5 vfdev-5 merged commit 1915603 into pytorch-ignite:main Jun 23, 2023
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants