Skip to content

Commit

Permalink
✅ Ready to clone and code.
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul-B98 authored and github-actions[bot] committed Dec 2, 2024
1 parent 436063c commit 1aa6436
Show file tree
Hide file tree
Showing 17 changed files with 32 additions and 34 deletions.
12 changes: 6 additions & 6 deletions .github/rename_project.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ echo "Description: $description";

echo "Renaming project..."

original_author="author_name"
original_name="project_name"
original_urlname="project_urlname"
original_description="project_description"
original_author="aidh-ms"
original_name="photonai_icu"
original_urlname="photonai_icu"
original_description="Awesome photonai_icu created by aidh-ms"
# for filename in $(find . -name "*.*")
for filename in $(git ls-files)
do
Expand All @@ -30,8 +30,8 @@ do
echo "Renamed $filename"
done

mv project_name $name
mv $name/project_name.json $name/$name.json
mv photonai_icu $name
mv $name/photonai_icu.json $name/$name.json

# This command runs only once on GHA!
rm -rf .github/template.yml
2 changes: 0 additions & 2 deletions .github/template.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

.idea/

project_name/registered
photonai_icu/registered

*.pyc
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ In order to add a new Algorithm / Feature to your project you can follow the ste
- [ ] Test your algorithms in a respective test file in the `test` folder
- [ ] Document algorithms in the `docs` folder by copying and adapting the provided .md file
- [ ] Provide an example on how to use your algorithms in an appropriately named file in the examples folder.
- [ ] Expose the algorithm to photonai by adding it to the the `project_name/project_name.json` file with the full path. An example is provided within this repository. Thereby, the algorithm can be imported via its name, as defined in the json file. Make sure to pick a unique name.
- [ ] Expose the algorithm to photonai by adding it to the the `photonai_icu/photonai_icu.json` file with the full path. An example is provided within this repository. Thereby, the algorithm can be imported via its name, as defined in the json file. Make sure to pick a unique name.

**In order to access your algorithms and functions in photonai you have to import your module once in your final script. This triggers the registration process in the photonai core module!**

Expand Down
2 changes: 1 addition & 1 deletion docs/api/DummyTransformer.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ A module for performing dummy transformations
!!! info
This is only a dummy transformer

::: project_name.dummy.DummyTransformer.DummyTransformer.__init__
::: photonai_icu.dummy.DummyTransformer.DummyTransformer.__init__
rendering:
show_root_toc_entry: False
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ In order to add a new Algorithm / Feature to your project you can follow the ste
- Test your algorithms in a respective test file in the `test` folder
- Document algorithms in the `docs` folder by copying and adapting the provided .md file
- Provide an example on how to use your algorithms in an appropriately named file in the examples folder.
- Expose the algorithm to photonai by adding it to the the `project_name/project_name.json` file with the full path. An example is provided within this repository. Thereby, the algorithm can be imported via its name, as defined in the json file. Make sure to pick a unique name.
- Expose the algorithm to photonai by adding it to the the `photonai_icu/photonai_icu.json` file with the full path. An example is provided within this repository. Thereby, the algorithm can be imported via its name, as defined in the json file. Make sure to pick a unique name.

**In order to access your algorithms and functions in photonai you have to import your module once in your final script. This triggers the registration process in the photonai core module!**
2 changes: 1 addition & 1 deletion examples/DummyTransformer/DummyTransformer_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"outputs": [],
"source": [
"# IMPORTANT: import your project once\n",
"import project_name"
"import photonai_icu"
]
},
{
Expand Down
6 changes: 3 additions & 3 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Project information
site_name: project_name
repo_name: 'project_urlname'
repo_url: 'https://github.com/wwu-mmll/project_name'
site_name: photonai_icu
repo_name: 'photonai_icu'
repo_url: 'https://github.com/wwu-mmll/photonai_icu'
edit_uri: 'edit/master/docs'


Expand Down
8 changes: 4 additions & 4 deletions project_name/__init__.py → photonai_icu/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,24 @@

def do_register(current_path, registered_file): # pragma: no cover
reg = PhotonRegistry()
reg.add_module(os.path.join(current_path, "project_name.json"))
reg.add_module(os.path.join(current_path, "photonai_icu.json"))
with open(os.path.join(registered_file), "w") as f:
f.write(str(__version__))


def register(): # pragma: no cover
current_path = os.path.dirname(os.path.abspath(__file__))
registered_file = os.path.join(current_path, "registered")
logger.info("Checking project_name Module Registration")
logger.info("Checking photonai_icu Module Registration")
if not os.path.isfile(registered_file): # pragma: no cover
logger.info("Registering project_name Module")
logger.info("Registering photonai_icu Module")
do_register(current_path=current_path, registered_file=registered_file)
else:
with open(os.path.join(registered_file), "r") as f:
if f.read() == __version__:
logger.info("Current version already registered")
else:
logger.info("Updating project_name Module")
logger.info("Updating photonai_icu Module")
do_register(current_path=current_path, registered_file=registered_file)


Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions photonai_icu/dummy/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from photonai_icu.dummy.DummyTransformer import DummyTransformer
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"DummyTransformer": [
"project_name.dummy.DummyTransformer",
"photonai_icu.dummy.DummyTransformer",
"Transformer"
]
}
3 changes: 3 additions & 0 deletions photonai_icu/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from pbr.version import VersionInfo

__version__ = VersionInfo('photonai_icu').release_string()
1 change: 0 additions & 1 deletion project_name/dummy/__init__.py

This file was deleted.

3 changes: 0 additions & 3 deletions project_name/version.py

This file was deleted.

16 changes: 8 additions & 8 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
[metadata]
name = project_name
name = photonai_icu
description_file = README.md
long_description_content_type = text/markdown
author = author_name
author = aidh-ms
author_email = insert_your@email
url = https://github.com//project_urlname/
url = https://github.com//photonai_icu/
keywords=
machine learning
deep learning
project_urls=
Source Code = https://github.com/author_name/project_name/
Documentation = https://author_name.github.io/project_name/
Bug Tracker = https://github.com/author_name/project_name/issues
Source Code = https://github.com/aidh-ms/photonai_icu/
Documentation = https://aidh-ms.github.io/photonai_icu/
Bug Tracker = https://github.com/aidh-ms/photonai_icu/issues

download_url=https://pypi.org/project/project_name/#files
download_url=https://pypi.org/project/photonai_icu/#files

[files]
packages = project_name
packages = photonai_icu
2 changes: 1 addition & 1 deletion test/dummy_tests/test_dummy.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from unittest import TestCase
import numpy as np

from project_name.dummy.DummyTransformer import DummyTransformer
from photonai_icu.dummy.DummyTransformer import DummyTransformer


class DummyTest(TestCase):
Expand Down

0 comments on commit 1aa6436

Please sign in to comment.