Skip to content

Commit

Permalink
add privacy notice and license to doc
Browse files Browse the repository at this point in the history
Signed-off-by: Zhiyuan Chen <[email protected]>
  • Loading branch information
ZhiyuanChen committed Jul 8, 2024
1 parent 04ee02b commit 9f6e780
Show file tree
Hide file tree
Showing 6 changed files with 1,783 additions and 1 deletion.
660 changes: 660 additions & 0 deletions docs/docs/about/license.md

Large diffs are not rendered by default.

248 changes: 248 additions & 0 deletions docs/docs/about/license.zh.md

Large diffs are not rendered by default.

403 changes: 403 additions & 0 deletions docs/docs/about/privacy.md

Large diffs are not rendered by default.

412 changes: 412 additions & 0 deletions docs/docs/about/privacy.zh.md

Large diffs are not rendered by default.

56 changes: 56 additions & 0 deletions docs/docs/scripts/test/example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# CHANfiG, Easier Configuration.
# Copyright (c) 2022-Present, CHANfiG Contributors

# This program is free software: you can redistribute it and/or modify
# it under the terms of the following licenses:
# - The Unlicense
# - GNU Affero General Public License v3.0 or later
# - GNU General Public License v2.0 or later
# - BSD 4-Clause "Original" or "Old" License
# - MIT License
# - Apache License 2.0

# 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 LICENSE file for more details.

from functools import partial

from chanfig import Config, Variable


class DataConfig(Config):
__test__ = False

def __init__(self, name):
super().__init__()
self.name = name

def post(self):
self.name = self.name.lower()


class TestConfig(Config):
__test__ = False

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
num_classes = Variable(10)
self.name = "CHANfiG"
self.seed = Variable(1013, help="random seed")
data_factory = partial(DataConfig, name="CIFAR10")
self.datasets = Config(default_factory=data_factory)
self.datas = Config(default_factory=data_factory)
self.datasets.a.num_classes = num_classes
self.datasets.b.num_classes = num_classes
self.network.name = "ResNet18"
self.network.num_classes = num_classes

def post(self):
self.name = self.name.lower()
self.id = f"{self.name}_{self.seed}"

@property
def data(self):
return next(iter(self.datas.values())) if self.datas else self.datas["default"]
5 changes: 4 additions & 1 deletion docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ nav:
- Development:
- Test: test.md
- Coverage: coverage.md
- About:
- License: about/license.md
- Privacy Notice: about/privacy.md

theme:
name: material
Expand Down Expand Up @@ -83,7 +86,7 @@ extra:
as to measure the effectiveness of our documentation and whether users
find what they're searching for. With your consent, you're helping us to
make our documentation better. Please check out our
<a href="https://zyc.ai/about/privacy">Privacy Policy</a> for more information.
<a href="https://chanfig.danling.org/about/privacy">Privacy Notice</a> for more information.
generator: false
manifest: "manifest.webmanifest"
# social:
Expand Down

0 comments on commit 9f6e780

Please sign in to comment.